home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mgr / doc / usrman.out < prev   
Text File  |  1980-12-31  |  178KB  |  3,697 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.                      M✓M✓M✓MG✓G✓G✓GR✓R✓R✓R -✓-✓-✓- C✓C✓C✓C L✓L✓L✓La✓a✓a✓an✓n✓n✓ng✓g✓g✓gu✓u✓u✓ua✓a✓a✓ag✓g✓g✓ge✓e✓e✓e A✓A✓A✓Ap✓p✓p✓pp✓p✓p✓pl✓l✓l✓li✓i✓i✓ic✓c✓c✓ca✓a✓a✓at✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓n I✓I✓I✓In✓n✓n✓nt✓t✓t✓te✓e✓e✓er✓r✓r✓rf✓f✓f✓fa✓a✓a✓ac✓c✓c✓ce✓e✓e✓e
  11.  
  12.  
  13.                                 Stephen A. Uhler
  14.  
  15.                           Bell Communications Research
  16.  
  17.  
  18.  
  19.                                     _✓A_✓B_✓S_✓T_✓R_✓A_✓C_✓T
  20.  
  21.             MGR (m✓m✓m✓manag✓g✓g✓ger✓r✓r✓r) is a window system  for  Unix  that  currently
  22.        runs  on  Sun  Workstations.  MGR manages asynchronous updates of
  23.        overlapping  windows  and  provides  application  support  for  a
  24.        heterogeneous  network environment, i.e., many different types of
  25.        computers connected by various communications media.  The  appli-
  26.        cation interface enables applications (called client programs) to
  27.        be written in a variety of programming languages, and run on dif-
  28.        ferent  operating  systems.   The  client  program  can take full
  29.        advantage of the windowing capabilities regardless of the type of
  30.        connection   to  the  workstation  running  MGR.   This  document
  31.        describes the C interface library for MGR which provides a set of
  32.        macros  and  functions  that implement the stream protocol.  This
  33.        library provides client programs written in  _✓C  with  a  function
  34.        call  interface  to  MGR.   The library provides the lowest level
  35.        access to MGR functions and represents a one to  one  mapping  to
  36.        the underlying stream protocol.
  37.  
  38.  
  39.  
  40.  July 7, 1988
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.                                      - _✓i -
  71.  
  72.  
  73.  
  74.  
  75.  
  76.                                T✓T✓T✓Ta✓a✓a✓ab✓b✓b✓bl✓l✓l✓le✓e✓e✓e o✓o✓o✓of✓f✓f✓f C✓C✓C✓Co✓o✓o✓on✓n✓n✓nt✓t✓t✓te✓e✓e✓en✓n✓n✓nt✓t✓t✓ts✓s✓s✓s
  77.  
  78.  
  79.  
  80.  
  81.  Introduction ............................................................    1
  82.  
  83.  Model of Interaction ....................................................    3
  84.  
  85.  Coordinate Systems ......................................................    3
  86.  
  87.  Functional Overview .....................................................    4
  88.  
  89.  Underlying Protocol .....................................................    7
  90.  
  91.  Conventions and Notation ................................................    9
  92.  
  93.  Macros ..................................................................   11
  94.  
  95.  Functions ...............................................................   36
  96.  
  97.  Using the Library .......................................................   40
  98.  
  99.  Glossary ................................................................   41
  100.  
  101.  Sample Client Program ...................................................   44
  102.  
  103.  Macros and Functions by Category ........................................   46
  104.  
  105.  Macro and Function Index ................................................   53
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.                      M✓M✓M✓MG✓G✓G✓GR✓R✓R✓R -✓-✓-✓- C✓C✓C✓C L✓L✓L✓La✓a✓a✓an✓n✓n✓ng✓g✓g✓gu✓u✓u✓ua✓a✓a✓ag✓g✓g✓ge✓e✓e✓e A✓A✓A✓Ap✓p✓p✓pp✓p✓p✓pl✓l✓l✓li✓i✓i✓ic✓c✓c✓ca✓a✓a✓at✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓n I✓I✓I✓In✓n✓n✓nt✓t✓t✓te✓e✓e✓er✓r✓r✓rf✓f✓f✓fa✓a✓a✓ac✓c✓c✓ce✓e✓e✓e
  143.  
  144.  
  145.                                 Stephen A. Uhler
  146.  
  147.                           Bell Communications Research
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.                      M✓M✓M✓MG✓G✓G✓GR✓R✓R✓R -✓-✓-✓- C✓C✓C✓C L✓L✓L✓La✓a✓a✓an✓n✓n✓ng✓g✓g✓gu✓u✓u✓ua✓a✓a✓ag✓g✓g✓ge✓e✓e✓e A✓A✓A✓Ap✓p✓p✓pp✓p✓p✓pl✓l✓l✓li✓i✓i✓ic✓c✓c✓ca✓a✓a✓at✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓n I✓I✓I✓In✓n✓n✓nt✓t✓t✓te✓e✓e✓er✓r✓r✓rf✓f✓f✓fa✓a✓a✓ac✓c✓c✓ce✓e✓e✓e
  209.  
  210.  
  211.                                 Stephen A. Uhler
  212.  
  213.                           Bell Communications Research
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  => _✓I_✓n_✓t_✓r_✓o_✓d_✓u_✓c_✓t_✓i_✓o_✓n
  221.  
  222.  MGR (m✓m✓m✓manag✓g✓g✓ger✓r✓r✓r) is a window system for Unix that currently runs on Sun  Worksta-
  223.  tions.   MGR  manages asynchronous updates of overlapping windows and provides
  224.  application support for a heterogeneous network environment, i.e.,  many  dif-
  225.  ferent  types  of  computers  connected  by various communications media.  The
  226.  application interface enables applications  (called  client  programs)  to  be
  227.  written  in a variety of programming languages, and run on different operating
  228.  systems.  The client program can take full advantage of the windowing capabil-
  229.  ities regardless of the type of connection to the workstation running MGR.
  230.  
  231.  Client programs communicate with MGR via _✓p_✓s_✓e_✓u_✓d_✓o-_✓t_✓e_✓r_✓m_✓i_✓n_✓a_✓l_✓s over a reliable byte
  232.  stream.   Each client program can create and manipulate one or more windows on
  233.  the display, with commands and data to the various  windows  multiplexed  over
  234.  the  same connection.  MGR provides ASCII terminal emulation and takes respon-
  235.  sibility for maintaining the integrity of the window contents  when  parts  of
  236.  windows become obscured and subsequently uncovered.  This permits naive appli-
  237.  cations to work without modification by providing a default  environment  that
  238.  appears to be an ordinary terminal.
  239.  
  240.  In addition to terminal emulation,  MGR  provides  each  client  window  with:
  241.  graphics primitives such as line and circle drawing; facilities for manipulat-
  242.  ing bitmaps, fonts, icons, and pop-up menus; commands to reshape and  position
  243.  windows; and a message passing facility enabling client programs to rendezvous
  244.  and exchange messages.  Client programs may ask to be informed when  a  change
  245.  in the window system occurs, such as a reshaped window, a pushed mouse button,
  246.  or a message sent from another  client  program.   These  changes  are  called
  247.  events.   MGR  notifies  a  client  program of an event by sending it an ASCII
  248.  character string in a format specified by the client program.  Existing appli-
  249.  cations  can be integrated into the windowing environment without modification
  250.  _________________________
  251.                Copyright (c) 1988 Bellcore
  252.                    All Rights Reserved
  253.  Permission is granted to  copy  or  use  this  program,
  254.  EXCEPT  that  it  may  not  be  sold  for  profit,  the
  255.  copyright notice must  be  reproduced  on  copies,  and
  256.  credit  should  be  given  to Bellcore where it is due.
  257.  BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR
  258.  THIS PROGRAM.
  259.  
  260.  
  261.  
  262.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  MGR-C Language Application Interface- 2 -                     Introduction
  269.  
  270.  
  271.  by having MGR imitate keystrokes in response to user defined  menus  or  other
  272.  events.
  273.  
  274.  The user interface provides a simple  point-and-select  model  of  interaction
  275.  using the mouse with pop-up menus and quick access to system functions through
  276.  meta-keys on the keyboard.  MGR also provides a _✓c_✓u_✓t and  _✓p_✓a_✓s_✓t_✓e  function  that
  277.  permits  a  user  to sweep out and copy text from any window and paste it into
  278.  any other.
  279.  
  280.  This document describes the low level C interface  library  for  MGR.   The  _✓C
  281.  _✓I_✓n_✓t_✓e_✓r_✓f_✓a_✓c_✓e  _✓l_✓i_✓b_✓r_✓a_✓r_✓y  provides a set of macros and functions which implement the
  282.  stream protocol and provide clients written in _✓C with a function  call  inter-
  283.  face  to  MGR.  This library provides the lowest level access to MGR functions
  284.  and represents a direct mapping to the underlying protocol.   It  is  expected
  285.  that  a  higher level interface will evolve to support application development
  286.  at a higher level.  The library requires only the UNIX  _✓S_✓t_✓a_✓n_✓d_✓a_✓r_✓d  _✓I/_✓O  _✓L_✓i_✓b_✓r_✓a_✓r_✓y
  287.  for  its  operation  and  access  to  a byte sequential I/O interface from the
  288.  underlying operating system.
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  MGR-C Language Application Interface- 3 -               Model of Interaction
  335.  
  336.  
  337.  => _✓M_✓o_✓d_✓e_✓l _✓o_✓f _✓I_✓n_✓t_✓e_✓r_✓a_✓c_✓t_✓i_✓o_✓n
  338.  
  339.  The basic unit within MGR is the window.  A window is a rectangular region  on
  340.  the  display,  surrounded  by  a  border,  with  a  single connection to other
  341.  processes.  All interactions among the client program, the user  and  MGR  are
  342.  defined  entirely  in terms of the state of a client's window or windows.  MGR
  343.  has no concept of window types; there are no separate _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s  _✓w_✓i_✓n_✓d_✓o_✓w_✓s,  _✓t_✓e_✓x_✓t
  344.  _✓w_✓i_✓n_✓d_✓o_✓w_✓s, or _✓e_✓d_✓i_✓t _✓w_✓i_✓n_✓d_✓o_✓w_✓s.  Every window supports exactly the same set of capa-
  345.  bilities as every other window.  In addition, all windows  act  independently.
  346.  Client  programs need not know or care about the existence of other clients or
  347.  windows that happen to coexist on the same display.  The management  of  over-
  348.  lapping  windows  is  handled  entirely by MGR.  For example, when a window is
  349.  partially or totally obscured by another window, then subsequently  uncovered,
  350.  MGR  restores  the  integrity  of  the  window's  contents.  There are no _✓s_✓u_✓b-
  351.  _✓w_✓i_✓n_✓d_✓o_✓w_✓s, windows whose size or position are in some way restricted by a parent
  352.  window.  A client may create and manipulate many windows, each of which may be
  353.  positioned and sized independently on the display.
  354.  
  355.  At any given time there is one special window on the display, the _✓a_✓c_✓t_✓i_✓v_✓e  win-
  356.  dow.   This is the window that receives keystrokes and mouse data.  It is dis-
  357.  tinguishable to the user from the other windows on the display by  its  embol-
  358.  dened  border.  The active window, in addition to receiving all mouse and key-
  359.  board data, is also logically in front of the other windows  on  the  display.
  360.  The  active  window  is, therefore, always completely exposed.  Any window can
  361.  become the active window, but there can only be one active window at a time.
  362.  
  363.  A client program may change its window at any time, write text into  it,  draw
  364.  lines,  anything,  so  long as the change is _✓l_✓o_✓c_✓a_✓l, that is the change affects
  365.  just its window.  Only the active window may  effect  _✓g_✓l_✓o_✓b_✓a_✓l  changes  to  the
  366.  display,  such  as  changing  its shape or position.  The only global action a
  367.  _✓n_✓o_✓n-_✓a_✓c_✓t_✓i_✓v_✓e window may perform is to become the  active  window.   This  window
  368.  model  provides  both  the  user and application developer with a simple, con-
  369.  sistent model of interaction.
  370.  
  371.  
  372.  => _✓C_✓o_✓o_✓r_✓d_✓i_✓n_✓a_✓t_✓e _✓S_✓y_✓s_✓t_✓e_✓m_✓s
  373.  
  374.  MGR uses four different coordinate systems,  _✓d_✓i_✓s_✓p_✓l_✓a_✓y  coordinates  ,  _✓a_✓b_✓s_✓o_✓l_✓u_✓t_✓e
  375.  _✓w_✓i_✓n_✓d_✓o_✓w  coordinates,  _✓r_✓e_✓l_✓a_✓t_✓i_✓v_✓e  _✓w_✓i_✓n_✓d_✓o_✓w coordinates, and _✓c_✓h_✓a_✓r_✓a_✓c_✓t_✓e_✓r coordinates.
  376.  The entire display is represented by _✓d_✓i_✓s_✓p_✓l_✓a_✓y _✓c_✓o_✓o_✓r_✓d_✓i_✓n_✓a_✓t_✓e_✓s whereas  each  window
  377.  has  its  own  _✓a_✓b_✓s_✓o_✓l_✓u_✓t_✓e _✓w_✓i_✓n_✓d_✓o_✓w, _✓r_✓e_✓l_✓a_✓t_✓i_✓v_✓e _✓w_✓i_✓n_✓d_✓o_✓w, and _✓c_✓h_✓a_✓r_✓a_✓c_✓t_✓e_✓r coordinate sys-
  378.  tems.
  379.  
  380.  _✓D_✓i_✓s_✓p_✓l_✓a_✓y _✓c_✓o_✓o_✓r_✓d_✓i_✓n_✓a_✓t_✓e_✓s are in units of pixels.  The coordinate ( 0✓0✓0✓0,0✓0✓0✓0)is  the  top
  381.  left  pixel  on  the  display.  The _✓X coordinate increases to the right, the _✓Y
  382.  coordinate increases down.  The maximum _✓X and _✓Y  coordinate  depend  upon  the
  383.  particular  display in use, for the SUN-3 they are 1✓1✓1✓11✓1✓1✓15✓5✓5✓52✓2✓2✓2 by 9✓9✓9✓90✓0✓0✓00✓0✓0✓0.  Commands that
  384.  operate on the context of the entire display, such as reshaping a  window  are
  385.  specified  in  _✓d_✓i_✓s_✓p_✓l_✓a_✓y coordinates.  Windows, when measured in _✓d_✓i_✓s_✓p_✓l_✓a_✓y coordi-
  386.  nates include their borders.
  387.  
  388.  _✓A_✓b_✓s_✓o_✓l_✓u_✓t_✓e _✓w_✓i_✓n_✓d_✓o_✓w _✓c_✓o_✓o_✓r_✓d_✓i_✓n_✓a_✓t_✓e_✓s, as with  _✓d_✓i_✓s_✓p_✓l_✓a_✓y  _✓c_✓o_✓o_✓r_✓d_✓i_✓n_✓a_✓t_✓e_✓s,  are  measured  in
  389.  units  of  pixels.   The X✓X✓X✓X and Y✓Y✓Y✓Y values increase to the right and down respec-
  390.  tively.  The origin, coordinate ( 0✓0✓0✓0,0✓0✓0✓0)is at the top left corner of the window,
  391.  just inside the window border.
  392.  
  393.  
  394.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  MGR-C Language Application Interface- 4 -                Coordinate Systems
  401.  
  402.  
  403.  _✓R_✓e_✓l_✓a_✓t_✓i_✓v_✓e _✓w_✓i_✓n_✓d_✓o_✓w _✓c_✓o_✓o_✓r_✓d_✓i_✓n_✓a_✓t_✓e_✓s are measured as a fraction of  the  window's  size
  404.  and shape.  As with _✓a_✓b_✓s_✓o_✓l_✓u_✓t_✓e _✓w_✓i_✓n_✓d_✓o_✓w _✓c_✓o_✓o_✓r_✓d_✓i_✓n_✓a_✓t_✓e_✓s, each window has its origin, (
  405.  0✓0✓0✓0,0✓0✓0✓0), at the top left corner of the window just inside the border, however the
  406.  lower right corner of the window is always at coordinate ( 9✓9✓9✓99✓9✓9✓99✓9✓9✓9,9✓9✓9✓99✓9✓9✓99✓9✓9✓9).  Graphics
  407.  commands to a window in _✓r_✓e_✓l_✓a_✓t_✓i_✓v_✓e _✓w_✓i_✓n_✓d_✓o_✓w _✓c_✓o_✓o_✓r_✓d_✓i_✓n_✓a_✓t_✓e_✓s are  automatically  scaled
  408.  to the size of the window.
  409.  
  410.  _✓C_✓h_✓a_✓r_✓a_✓c_✓t_✓e_✓r _✓c_✓o_✓o_✓r_✓d_✓i_✓n_✓a_✓t_✓e_✓s are measured in rows and columns in  the  current  font,
  411.  just  like an ordinary terminal.  The coordinate ( 0✓0✓0✓0,0✓0✓0✓0)is the top left charac-
  412.  ter position in the window.  The maximum _✓r_✓o_✓w and _✓c_✓o_✓l_✓u_✓m_✓n in the window  depends
  413.  on both the window and font size.
  414.  
  415.  
  416.  => _✓F_✓u_✓n_✓c_✓t_✓i_✓o_✓n_✓a_✓l _✓O_✓v_✓e_✓r_✓v_✓i_✓e_✓w
  417.  
  418.  The types of commands a client program may  issue  MGR  are  divided  into  14
  419.  categories:  _✓t_✓e_✓r_✓m_✓i_✓n_✓a_✓l  _✓e_✓m_✓u_✓l_✓a_✓t_✓i_✓o_✓n, _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s, _✓b_✓i_✓t-_✓b_✓l_✓t_✓s, _✓w_✓i_✓n_✓d_✓o_✓w _✓p_✓o_✓s_✓i_✓t_✓i_✓o_✓n_✓i_✓n_✓g, _✓f_✓o_✓n_✓t
  420.  _✓c_✓h_✓a_✓n_✓g_✓e_✓s, _✓s_✓t_✓a_✓t_✓e _✓i_✓n_✓q_✓u_✓i_✓r_✓y, _✓s_✓a_✓v_✓e_✓d _✓c_✓o_✓n_✓t_✓e_✓x_✓t_✓s, _✓m_✓e_✓n_✓u_✓s, _✓e_✓v_✓e_✓n_✓t_✓s, _✓s_✓w_✓e_✓e_✓p _✓f_✓u_✓n_✓c_✓t_✓i_✓o_✓n_✓s, _✓m_✓u_✓l_✓t_✓i_✓-
  421.  _✓p_✓l_✓e _✓w_✓i_✓n_✓d_✓o_✓w _✓m_✓a_✓n_✓i_✓p_✓u_✓l_✓a_✓t_✓i_✓o_✓n, _✓c_✓u_✓t _✓a_✓n_✓d _✓p_✓a_✓s_✓t_✓e, _✓m_✓e_✓s_✓s_✓a_✓g_✓e_✓s, and _✓w_✓i_✓n_✓d_✓o_✓w _✓m_✓o_✓d_✓e_✓s.  What fol-
  422.  lows is a brief description of those command categories, and some examples  of
  423.  specific  functions  within the category.  A detailed description of each com-
  424.  mand is provided in the following section.
  425.  
  426.  _✓T_✓e_✓r_✓m_✓i_✓n_✓a_✓l _✓E_✓m_✓u_✓l_✓a_✓t_✓i_✓o_✓n
  427.  At its basic level, every MGR window emulates a  _✓C_✓R_✓T  terminal.   It  provides
  428.  functions  for _✓i_✓n_✓s_✓e_✓r_✓t_✓i_✓n_✓g and _✓d_✓e_✓l_✓e_✓t_✓i_✓n_✓g lines and characters, highlighting text,
  429.  clearing areas and windows, and arbitrary cursor motion capabilities.   Sample
  430.  MGR  _✓T_✓E_✓R_✓M_✓C_✓A_✓P  and  _✓T_✓E_✓R_✓M_✓I_✓N_✓F_✓O  descriptions  are  given in the tables below.  No
  431.  entries are provided for keyboard key values, as they depend upon the particu-
  432.  l✓_a✓_r✓__k✓_e✓_y✓_b✓_o✓_a✓_r✓_d✓__i✓_n✓__u✓_s✓_e✓_.✓___________________________________________________________
  433. |   Sample MGR _✓T_✓E_✓R_✓M_✓C_✓A_✓P Entry  |✓|           Sample MGR _✓T_✓E_✓R_✓M_✓I_✓N_✓F_✓O Entry           |
  434. |______________________________✓|✓|________________________________________________✓|
  435. | Px  MGR  MGR terminal:\     |✓| Px | MGR | MGR Terminal,                      |
  436. |   :am:bs:im=:ta=^I:\        |✓|   cols#80, lines#24,                          |
  437. |   :AL=\E%da:al=\Ea:\        |✓|   am, msgr, ht=^I,                            |
  438. |   :cd=\EC:ce=\Ec:cl=^L:\    |✓|   clear=^L, cr=^M, bel=^G,                    |
  439. |   :cm=\E%r%d,%dM:\          |✓|   cub1=^H, cud1=\Ef, cuf1=\Er,                |
  440. |   :co#80:li#24:\            |✓|   cuu1=\Eu, ind=^J,                           |
  441. |   :cs=\E%d,%dt:\            |✓|   cup=\E%p2%d;%p1%dM,                         |
  442. |   :DC=\E%dE:dc=\EE:\        |✓|   csr=\E%p1%d;%p2%dt,                         |
  443. |   :DL=\E%dd:dl=\Ed:\        |✓|   wind=\E%p2%d;%p2%p4%+%d;%p1;%p1%p3%+%d;t,   |
  444. |   :do=\Ef:up=\Eu:nd=\Er:\   |✓|   el=\Ec, ed=\EC,                             |
  445. |   :IC=\E%dA:ic=\EA:\        |✓|   il1=\Ea, dl1=\Ed,                           |
  446. |   :se=\En:so=\Ei:\          |✓|   il=\E%p1%da, dl=\E%p1%dd,                   |
  447. |___:✓_v✓_e✓_=✓_\✓_E✓_v✓_:✓_v✓_s✓_=✓_\✓_E✓_V✓_:✓_____________✓|✓|   smso=\Ei, rmso=\En,                         |
  448.                               |___s✓_m✓_c✓_u✓_p✓_=✓_\✓_E✓_1✓_6✓_6✓_4✓_P✓_,✓__r✓_m✓_c✓_u✓_p✓_=✓_\✓_E✓_t✓_\✓_E✓_p✓_,✓__________________✓|
  449.  
  450.  MGR permits the client program to restrict the terminal emulator to  an  arbi-
  451.  trary  subrectangle  within  the window, called a _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n.  For example, a
  452.  text editor wishing to provide scroll bars or banner lines can still  let  MGR
  453.  do  the  terminal  emulation by specifying a text region that excludes the top
  454.  and sides of the window.  This text region may be redefined or moved around at
  455.  will, permitting multiple terminal sub regions in the same window.
  456.  
  457.  
  458.  
  459.  
  460.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  MGR-C Language Application Interface- 5 -               Functional Overview
  467.  
  468.  
  469.  _✓G_✓r_✓a_✓p_✓h_✓i_✓c_✓s
  470.  In addition to terminal emulation, MGR provides a suite of pen  plotter  style
  471.  graphics  primitives.  A client program may draw lines, circles, ellipses, and
  472.  elliptical arcs on a window.  The graphics objects may  either  be  completely
  473.  positioned,  or  located relative to an internal _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s _✓p_✓o_✓i_✓n_✓t, maintained by
  474.  MGR.  The objects may also be drawn into undisplayed or _✓s_✓c_✓r_✓a_✓t_✓c_✓h_✓p_✓a_✓d areas, then
  475.  copied to the window as a single unit.  The _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s _✓p_✓o_✓i_✓n_✓t may be aligned with
  476.  the character cursor, for locating graphic objects relative to character text.
  477.  Conversely, the character cursor may be aligned with the graphics cursor, per-
  478.  mitting character text to be placed at arbitrary positions on the window.
  479.  
  480.  _✓B_✓i_✓t-_✓b_✓l_✓t_✓s
  481.  MGR provides a complete set of functions for dealing  with  bitmaps,  or  rec-
  482.  tangular  arrays of pixels.  Bitmaps may be combined with any of the 16 possi-
  483.  ble _✓b_✓i_✓t-_✓b_✓l_✓t operations.   Non-displayed  bitmaps  of  arbitrary  size  may  be
  484.  created  and  destroyed, and _✓b_✓i_✓t-_✓b_✓l_✓t_✓s may be performed on the window, within a
  485.  scratch-pad bitmap, between two scratch-pad  bitmaps, or between a scratch-pad
  486.  bitmap  and the window.  Bitmap images may be down-loaded from client programs
  487.  to MGR, or up-loaded from MGR to the client program.  In addition, bitmaps may
  488.  be saved in files by MGR, or loaded into MGR from files.  These last two capa-
  489.  bilities permit client programs to manipulate large  amounts  of  bitmap  data
  490.  without the need to send the bits over the communication channel.
  491.  
  492.  _✓W_✓i_✓n_✓d_✓o_✓w _✓P_✓o_✓s_✓i_✓t_✓i_✓o_✓n_✓i_✓n_✓g
  493.  Either the user or client program may move the _✓a_✓c_✓t_✓i_✓v_✓e  window  around  on  the
  494.  display.   Windows  may be moved with their size retained, reshaped but remain
  495.  at the same location, or be both moved and shaped anywhere on the display.  If
  496.  the  window  is the _✓a_✓c_✓t_✓i_✓v_✓e window, it may be _✓b_✓u_✓r_✓i_✓e_✓d (shoved to the back on the
  497.  display).  If the window is not the _✓a_✓c_✓t_✓i_✓v_✓e window, it can  become  the  active
  498.  window and then moved about on the display.
  499.  
  500.  _✓F_✓o_✓n_✓t _✓C_✓h_✓a_✓n_✓g_✓e_✓s
  501.  Client programs may change character fonts at any time, even on a character by
  502.  character  basis.   MGR  comes with scores of different fonts, ranging in size
  503.  from microscopic to viewgraph size.  Client programs are free  to  create  and
  504.  down-load their own fonts.  The fonts supplied by MGR are constant width, that
  505.  is _✓i's take up the same amount of room as _✓m's do.  There are commands  to  aid
  506.  client programs that wish to use proportional fonts.
  507.  
  508.  _✓S_✓t_✓a_✓t_✓e _✓I_✓n_✓q_✓u_✓i_✓r_✓y
  509.  A client program may ask MGR about the state of its current  window,  such  as
  510.  its  size  and position on the display, the name and size of the current font,
  511.  the position and extent of the text region, and the state of various mode set-
  512.  tings.   The client may also inquire about the state of the window system as a
  513.  whole.  That includes the position and state of  the  mouse,  the  number  and
  514.  sizes  of the available fonts, and the organization of windows on the display.
  515.  The display organization may include the position, size, name, ownership,  and
  516.  spatial ordering for all windows on the display.
  517.  
  518.  _✓S_✓a_✓v_✓e_✓d _✓C_✓o_✓n_✓t_✓e_✓x_✓t_✓s
  519.  Certain parts of the current window environment may be pushed on a stack, then
  520.  restored  at some later time.  Client programs rarely need to know the context
  521.  in which they are called.  They simply push those aspects of  the  environment
  522.  they  will  change, then restore them before exiting.  About a dozen different
  523.  
  524.  
  525.  
  526.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  MGR-C Language Application Interface- 6 -               Functional Overview
  533.  
  534.  
  535.  parts of the window environment, such as menus, character fonts, window  posi-
  536.  tion, etc. may be stacked independently, or in any combination.
  537.  
  538.  _✓M_✓e_✓n_✓u_✓s
  539.  MGR has built in support for pop-up menus.  Clients may arrange for  menus  to
  540.  pop-up in response to mouse button hits.  Up to 50 menus may be down-loaded at
  541.  once for each window.  The client _✓s_✓e_✓l_✓e_✓c_✓t_✓s which menu will pop-up when a  mouse
  542.  button  is  pushed.   When an item of a pop-up menu is chosen, MGR returns the
  543.  string previously put into the menu by the client program.  The client program
  544.  may  arrange  for  different  menus to pop up depending upon the current mouse
  545.  position.  Menus may also be linked together as a pop-up menu  tree.   Sliding
  546.  off  to  the  right of a menu (called a _✓p_✓a_✓r_✓e_✓n_✓t menu) while an item is selected
  547.  can cause another menu (called a _✓c_✓h_✓i_✓l_✓d menu) to  pop  up.   Any  item  of  the
  548.  _✓p_✓a_✓r_✓e_✓n_✓t menu may be specified as the entry item for a child menu.  Upon select-
  549.  ing an item of a _✓c_✓h_✓i_✓l_✓d menu, the client program may arrange for MGR to  return
  550.  ether  the  action  string  associated  with  just the _✓c_✓h_✓i_✓l_✓d menu item, or the
  551.  action strings for the selected items of all the menus.   Similar  to  _✓s_✓l_✓i_✓d_✓i_✓n_✓g
  552.  menus,  MGR  supports  _✓p_✓a_✓g_✓i_✓n_✓g  menus  as  well.  Long menus may be broken into
  553.  several pages by the client program.  MGR manages  the  paging  automatically,
  554.  popping up the next page as the user slides off the bottom of a paged menu.
  555.  
  556.  _✓E_✓v_✓e_✓n_✓t_✓s
  557.  Client programs may arrange to be informed by MGR when some change, called  an
  558.  event,  happens to the state of the window system.  As with menus, the message
  559.  informing the client program of a change  is  formated  as  specified  by  the
  560.  client  program.   Examples of events include mouse buttons being depressed or
  561.  released, windows changing shape or moving, and the window becoming the _✓a_✓c_✓t_✓i_✓v_✓e
  562.  window  or being covered by another window.  Window state information, such as
  563.  the current cursor position, may be returned as part of an event string.
  564.  
  565.  _✓S_✓w_✓e_✓e_✓p _✓F_✓u_✓n_✓c_✓t_✓i_✓o_✓n_✓s
  566.  It is often convenient for client programs to  _✓s_✓w_✓e_✓e_✓p,  or  _✓r_✓u_✓b_✓b_✓e_✓r-_✓b_✓a_✓n_✓d  simple
  567.  objects,  such  as  lines or boxes, in response to moving the mouse.  MGR pro-
  568.  vides client programs with a mouse activated sweep function.   MGR  tracks  an
  569.  edge  of  the  line  or  box with the mouse and reports the coordinates to the
  570.  client at the conclusion of the sweep operation, when the  user  releases  the
  571.  mouse.  As usual, the client program specifies the format of the data returned
  572.  by MGR.
  573.  
  574.  _✓M_✓u_✓l_✓t_✓i_✓p_✓l_✓e _✓W_✓i_✓n_✓d_✓o_✓w _✓M_✓a_✓n_✓i_✓p_✓u_✓l_✓a_✓t_✓i_✓o_✓n
  575.  A single client program may create and manipulate additional  windows,  called
  576.  _✓a_✓l_✓t_✓e_✓r_✓n_✓a_✓t_✓e  windows.   The data destined for, or to be received from, an _✓a_✓l_✓t_✓e_✓r_✓-
  577.  _✓n_✓a_✓t_✓e window is multiplexed on the same channel as the main window.  The client
  578.  program  selects  a  window  to  receive  output,  and  all output goes to the
  579.  selected window until a different window is selected.  For input,  the  client
  580.  program uses the _✓e_✓v_✓e_✓n_✓t mechanism to determine from which window input arrived.
  581.  Alternate windows have the same capabilities as the  main  window.   There  is
  582.  currently  no  limit  to  the number of alternate windows a client program may
  583.  have.  Up to 100 windows may exist on the display at one time  before  perfor-
  584.  mance begins to degrade seriously.
  585.  
  586.  _✓C_✓u_✓t _✓a_✓n_✓d _✓P_✓a_✓s_✓t_✓e
  587.  MGR provides a globally accessible _✓s_✓n_✓a_✓r_✓f buffer shared among all  client  pro-
  588.  grams.   Any  client  program may put data into or read data from this buffer.
  589.  
  590.  
  591.  
  592.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  MGR-C Language Application Interface- 7 -               Functional Overview
  599.  
  600.  
  601.  MGR provides a user initiated _✓c_✓u_✓t and _✓p_✓a_✓s_✓t_✓e function from  the  command  menu.
  602.  MGR  extracts  character text from the window and places its ASCII representa-
  603.  tion into the _✓s_✓n_✓a_✓r_✓f buffer.  _✓P_✓a_✓s_✓t_✓e copies the contents of the _✓s_✓n_✓a_✓r_✓f buffer  to
  604.  the  input  stream of the active window.  Client programs, by manipulating the
  605.  data in the _✓s_✓n_✓a_✓r_✓f buffer, can interact with the system  _✓c_✓u_✓t  and  _✓p_✓a_✓s_✓t_✓e  func-
  606.  tions.
  607.  
  608.  _✓M_✓e_✓s_✓s_✓a_✓g_✓e_✓s
  609.  Although the _✓s_✓n_✓a_✓r_✓f buffer gives client programs a simple  asynchronous  inter-
  610.  process  communication mechanism, MGR has a more general synchronous interpro-
  611.  cess message passing scheme.  A client program may send a message  to  another
  612.  client program, or broadcast the message to all client programs.  As a message
  613.  recipient, the client program may elect to receive messages as  an  _✓e_✓v_✓e_✓n_✓t  and
  614.  encapsulate the message and sender name in the format of its choice.  MGR pro-
  615.  vides the primitives needed to implement _✓s_✓e_✓r_✓v_✓e_✓r clients by permitting  _✓s_✓e_✓r_✓v_✓e_✓r_✓s
  616.  to register their names, services and protocols with MGR.  Client programs may
  617.  query MGR for a list of active _✓s_✓e_✓r_✓v_✓e_✓r_✓s.  _✓S_✓e_✓r_✓v_✓e_✓r  messages  may  be  associated
  618.  with  windows  by the _✓s_✓e_✓r_✓v_✓e_✓r client programs in such a way that the message is
  619.  automatically received by a client program as part of  a  _✓m_✓o_✓u_✓s_✓e  _✓b_✓u_✓t_✓t_✓o_✓n  event
  620.  whenever  the  mouse  button  is  pressed  on the _✓s_✓e_✓r_✓v_✓e_✓r's window.  Using this
  621.  mechanism, client programs  can  interact  with  _✓s_✓e_✓r_✓v_✓e_✓r  clients  without  any
  622.  advance  knowledge  of  which  _✓s_✓e_✓r_✓v_✓e_✓rs are available or what services they are
  623.  providing.
  624.  
  625.  _✓W_✓i_✓n_✓d_✓o_✓w _✓M_✓o_✓d_✓e_✓s
  626.  Client programs may select various combinations of window modes.  These  modes
  627.  tailor  the  behavior of the macros described above.  Examples of window modes
  628.  include _✓a_✓u_✓t_✓o _✓l_✓i_✓n_✓e _✓w_✓r_✓a_✓p and _✓c_✓h_✓a_✓r_✓a_✓c_✓t_✓e_✓r _✓o_✓v_✓e_✓r_✓s_✓t_✓r_✓i_✓k_✓e that affect the terminal  emu-
  629.  lation, different coordinate system settings that affect _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s commands, or
  630.  flags that set a window to _✓a_✓c_✓t_✓i_✓v_✓a_✓t_✓e automatically upon receiving input, ignore
  631.  all keyboard input, or suspend output while a window is obscured.
  632.  
  633.  
  634.  => _✓U_✓n_✓d_✓e_✓r_✓l_✓y_✓i_✓n_✓g _✓P_✓r_✓o_✓t_✓o_✓c_✓o_✓l
  635.  
  636.  The purpose of this library package is both to provide a function call  inter-
  637.  face  to  the stream protocol, and to document each command understood by MGR.
  638.  There are two types_o✓_f✓__M✓_G✓_R✓__c✓_o✓_m✓_m✓_a✓_n✓_d✓_s✓_,✓__a✓_s✓__s✓_u✓_m✓_m✓_a✓_r✓_i✓_z✓_e✓_d✓__i✓_n✓__t✓_h✓_e✓__t✓_able below.
  639.                    |          MGR command protocol         |
  640.                    |________________________________________✓|
  641.                    | _✓E_✓S_✓C X1, X2,..., Xn _✓c_✓o_✓m_✓m_✓a_✓n_✓d            |
  642.                    | _✓E_✓S_✓C X1, X2,..., Xn _✓l_✓e_✓n_✓g_✓t_✓h _✓c_✓o_✓m_✓m_✓a_✓n_✓d _✓d_✓a_✓t_✓a|
  643.                    |________________________________________✓|
  644.  In both cases, _✓E_✓S_✓C is the ASCII escape character or '\033', whereas  the  word
  645.  _✓c_✓o_✓m_✓m_✓a_✓n_✓d  represents  a  single  character  command  identifier.   The  _✓X's are
  646.  optional integers,  there can be as f✓_e✓_w✓__a✓_s✓_ zero, as in the command
  647.                                     | E✓E✓E✓ES✓S✓S✓SC✓C✓C✓C_✓a|
  648.                                     |______✓|
  649.  which inserts a blank line in the window, or as many as  eight,  as  would  be
  650.  used by the command       __________________________
  651.                           | E✓E✓E✓ES✓S✓S✓SC✓C✓C✓C0,0,50,100,10,20,3,2_✓b|
  652.                           |__________________________✓|
  653.  which is an example of a command to copy images between  bitmaps.   No  spaces
  654.  may  be  included between the _✓E_✓S_✓C character and the command identifier charac-
  655.  ter, but the argument separators may be either commas (,) or semicolons (;).
  656.  
  657.  
  658.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  MGR-C Language Application Interface- 8 -               Underlying Protocol
  665.  
  666.  
  667.  The function of the command is determined both by the command identifier char-
  668.  acter  and _✓n, the number of numeric arguments preceding the command identifier
  669.  character.  All of the commands with the same command identifier character are
  670.  closely  related  in function.  For example, all the commands in the following
  671.  table have the same command character, '_✓o', and all draw  ellipses,  but  have
  672.  different effects based upon the number of arguments.
  673.                          _____________________________
  674.                         |_C✓_o✓_m✓_m✓_a✓_n✓_d✓_s✓__t✓_h✓_a✓_t✓__d✓_r✓_a✓_w✓___✓_✓e_✓_✓l_✓_✓l_✓_✓i_✓_✓p_✓_✓s_✓_✓e_✓_✓s_✓|
  675.                         | 1  |  E✓E✓E✓ES✓S✓S✓SC✓C✓C✓C100,200o✓o✓o✓o          |
  676.                         | 2  |  E✓E✓E✓ES✓S✓S✓SC✓C✓C✓C100,200,300,400o✓o✓o✓o  |
  677.                         | 3  |  E✓E✓E✓ES✓S✓S✓SC✓C✓C✓C100,200,300,400,2o✓o✓o✓o|
  678.                         |_____✓|________________________✓|
  679.  All of the ellipses have major and minor axis lengths of  _✓1_✓0_✓0  and  _✓2_✓0_✓0  units
  680.  respectively.   Command  1 draws the ellipse at the current graphics location.
  681.  Command 2 draws the ellipse at the location specified by the third  and  forth
  682.  arguments,  at ( 3✓3✓3✓30✓0✓0✓00✓0✓0✓0,4✓4✓4✓40✓0✓0✓00✓0✓0✓0).  Command 3 draws the ellipse into scratchpad bitmap
  683.  number _✓2.
  684.  
  685.  The second form of MGR commands, which is a special case of the first form, is
  686.  used  for downloading data from the client program to MGR.  The integer _✓l_✓e_✓n_✓g_✓t_✓h
  687.  specifies the number of bytes of data to  be  downloaded,  and  _✓d_✓a_✓t_✓a  are  the
  688.  _✓l_✓e_✓n_✓g_✓t_✓h number of data values downloaded.  An example of the second type of MGR
  689.  command is                    _________________
  690.                               | E✓E✓E✓ES✓S✓S✓SC✓C✓C✓C11,7b✓b✓b✓b_✓I-_✓m_✓o_✓v_✓e_✓d|
  691.                               |_________________✓|
  692.  which instructs MGR to send the client program the string _✓I-_✓m_✓o_✓v_✓e_✓d any time the
  693.  client's  window  is  moved  to  a  different location on the display.  The _✓1_✓1
  694.  refers to the number of the _✓m_✓o_✓v_✓e event and the _✓7 is the number  of  characters
  695.  in the event string, which in this case is _✓I-_✓m_✓o_✓v_✓e_✓d.
  696.  
  697.  All of the command identifier characters are listed in _✓w_✓i_✓n_✓d_✓o_✓w._✓h.  The  command
  698.  actions, determined by the command identifier and number of command arguments,
  699.  are described by the macros in this document.
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  MGR-C Language Application Interface- 9 -           Conventions and Notation
  731.  
  732.  
  733.  => _✓C_✓o_✓n_✓v_✓e_✓n_✓t_✓i_✓o_✓n_✓s _✓a_✓n_✓d _✓N_✓o_✓t_✓a_✓t_✓i_✓o_✓n
  734.  
  735.  All functions and macros and programming examples are shown  in  a  typewriter
  736.  font  to  distinguish  them from ordinary text.  Similarly, function and macro
  737.  arguments are shown in a b✓b✓b✓bo✓o✓o✓ol✓l✓l✓ld✓d✓d✓d t✓t✓t✓ty✓y✓y✓yp✓p✓p✓pe✓e✓e✓ew✓w✓w✓wr✓r✓r✓ri✓i✓i✓it✓t✓t✓te✓e✓e✓er✓r✓r✓r f✓f✓f✓fo✓o✓o✓on✓n✓n✓nt✓t✓t✓t.✓.✓.✓.
  738.  
  739.  The names of often used arguments passed to macros  indicate  their  function,
  740.  and are defined below.
  741.  
  742.  c✓c✓c✓co✓o✓o✓ol✓l✓l✓lu✓u✓u✓um✓m✓m✓mn✓n✓n✓n,r✓r✓r✓ro✓o✓o✓ow✓w✓w✓w
  743.       The integers c✓c✓c✓co✓o✓o✓ol✓l✓l✓lu✓u✓u✓um✓m✓m✓mn✓n✓n✓n and r✓r✓r✓ro✓o✓o✓ow✓w✓w✓w refer to a character  position  in  _✓c_✓h_✓a_✓r_✓a_✓c_✓t_✓e_✓r
  744.       coordinates even though characters may be placed at arbitrary pixel loca-
  745.       tions within a window and need not fall on c✓c✓c✓co✓o✓o✓ol✓l✓l✓lu✓u✓u✓um✓m✓m✓mn✓n✓n✓n or r✓r✓r✓ro✓o✓o✓ow✓w✓w✓w boundaries.
  746.  
  747.  D✓D✓D✓Dw✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h,D✓D✓D✓Dh✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t
  748.       The integers D✓D✓D✓Dw✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h and D✓D✓D✓Dh✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t represent a width and height  in  _✓d_✓i_✓s_✓p_✓l_✓a_✓y
  749.       coordinates.
  750.  
  751.  m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e
  752.       The positive integer m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e,  represents  the  bit  combination  of  window
  753.       modes.   M✓M✓M✓Mo✓o✓o✓od✓d✓d✓de✓e✓e✓e  is usually an _✓o_✓red list of constants in _✓t_✓e_✓r_✓m._✓h.  A typical
  754.       use of m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e is the argument to m_push( m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e)  as  in  m_push(  P✓P✓P✓P_✓_✓_✓_F✓F✓F✓FL✓L✓L✓LA✓A✓A✓AG✓G✓G✓GS✓S✓S✓S  |✓|✓|✓|
  755.       P✓P✓P✓P_✓_✓_✓_E✓E✓E✓EV✓V✓V✓VE✓E✓E✓EN✓N✓N✓NT✓T✓T✓T |✓|✓|✓| P✓P✓P✓P_✓_✓_✓_M✓M✓M✓ME✓E✓E✓EN✓N✓N✓NU✓U✓U✓U).
  756.  
  757.  n✓n✓n✓n
  758.       The small non-negative integer n✓n✓n✓n represents a  resource  descriptor  when
  759.       describing objects such as windows, fonts, or menus.
  760.  
  761.  n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e
  762.       N✓N✓N✓Na✓a✓a✓am✓m✓m✓me✓e✓e✓e is the file name of a bitmap image on the  _✓M_✓G_✓R-_✓h_✓o_✓s_✓t  machine.   File
  763.       names  given with no directory prefix are referenced relative to the _✓i_✓c_✓o_✓n
  764.       subdirectory of MGR's home directory.  The home directory is installation
  765.       dependent, and may be determined with the command _✓M_✓G_✓R -_✓V.
  766.  
  767.  p✓p✓p✓pa✓a✓a✓ar✓r✓r✓re✓e✓e✓en✓n✓n✓nt✓t✓t✓t,c✓c✓c✓ch✓h✓h✓hi✓i✓i✓il✓l✓l✓ld✓d✓d✓d
  768.       The small positive integers p✓p✓p✓pa✓a✓a✓ar✓r✓r✓re✓e✓e✓en✓n✓n✓nt✓t✓t✓t and c✓c✓c✓ch✓h✓h✓hi✓i✓i✓il✓l✓l✓ld✓d✓d✓d represent  menus.   A  _✓c_✓h_✓i_✓l_✓d
  769.       menu is linked to a _✓p_✓a_✓r_✓e_✓n_✓t menu forming a tree of menus.
  770.  
  771.  r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s
  772.       The positive integer r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s along with r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s1✓1✓1✓1 and  r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s2✓2✓2✓2  signifies  a
  773.       radius  when  referring to circles or major and minor axis when referring
  774.       to ellipses.  They are only referenced in respect to _✓w_✓i_✓n_✓d_✓o_✓w coordinates.
  775.  
  776.  s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g
  777.       An array of characters, s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g  is  a  null  terminated  ASCII  character
  778.       string.   Except  where  noted,  several  ASCII control characters can be
  779.       included in strings by escaping them with \_✓X,  where  _✓X  is  one  of  the
  780.       characters shown in the following table.
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  MGR-C Language Application Interface- 10 -          Conventions and Notation
  797.  
  798.  
  799.                        _______________________________________
  800.                       |__C✓_h✓_a✓_r✓_a✓_c✓_t✓_e✓_r✓__s✓_t✓_r✓_i✓_n✓_g✓__c✓_o✓_n✓_t✓_r✓_o✓_l✓__c✓_h✓_a✓_r✓_a✓_c✓_t✓_e✓_r✓_s✓___✓|
  801.                       |  escape  |  octal|       Meaning     |
  802.                       | character|  value|                   |
  803.                       |_✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓|✓__✓__✓__✓__✓__✓__✓__✓__✓|✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓|✓_
  804.                       |        \b|  010  |  Back space       |
  805.                       |        \E|  033  |  Escape           |
  806.                       |        \e|  033  |  Escape           |
  807.                       |        \f|  014  |  Form feed        |
  808.                       |        \g|  007  |  Bell             |
  809.                       |        \M|  *    |  Turn on          |
  810.                       |          |       |  8'th (parity) bit|
  811.                       |        \n|  012  |  New line         |
  812.                       |        \r|  015  |  Return           |
  813.                       |        \s|  040  |  Space            |
  814.                       |        \\|  134  |  Back-slash (\)   |
  815.                       |✓|___________✓|________✓|____________________✓|✓|
  816.                   * (the next character has its 8'th bit turned on)
  817.  
  818.  t✓t✓t✓to✓o✓o✓o,f✓f✓f✓fr✓r✓r✓ro✓o✓o✓om✓m✓m✓m
  819.       The small positive integers t✓t✓t✓to✓o✓o✓o and  f✓f✓f✓fr✓r✓r✓ro✓o✓o✓om✓m✓m✓m  identify  the  destination  and
  820.       source bitmaps for _✓b_✓i_✓t-_✓b_✓l_✓t operations.  The value 0 (zero) represents the
  821.       current window bitmap; positive integers name scratch-pad bitmap storage.
  822.  
  823.  w✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h,h✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t
  824.       The integers w✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h and h✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t represent a  width  and  height  in  _✓w_✓i_✓n_✓d_✓o_✓w
  825.       coordinates.
  826.  
  827.  X✓X✓X✓X,Y✓Y✓Y✓Y
  828.       The integer pair ( X✓X✓X✓X,Y✓Y✓Y✓Y) represents a point in _✓d_✓i_✓s_✓p_✓l_✓a_✓y  coordinates.   The
  829.       suffixes  s✓s✓s✓sr✓r✓r✓rc✓c✓c✓c  and d✓d✓d✓ds✓s✓s✓st✓t✓t✓t as in ( X✓X✓X✓X_✓_✓_✓_s✓s✓s✓sr✓r✓r✓rc✓c✓c✓c,Y✓Y✓Y✓Y_✓_✓_✓_s✓s✓s✓sr✓r✓r✓rc✓c✓c✓c) or ( X✓X✓X✓X_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,Y✓Y✓Y✓Y_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t) are used to
  830.       indicate _✓s_✓o_✓u_✓r_✓c_✓e and _✓d_✓e_✓s_✓t_✓i_✓n_✓a_✓t_✓i_✓o_✓n coordinates respectively.  Similarly, the
  831.       suffixes  1✓1✓1✓1 and 2✓2✓2✓2 as in ( X✓X✓X✓X1✓1✓1✓1,Y✓Y✓Y✓Y1✓1✓1✓1) refer generically to the first or second
  832.       coordinate.
  833.  
  834.  x✓x✓x✓x,y✓y✓y✓y
  835.       The integers ( x✓x✓x✓x,y✓y✓y✓y) represent a point  in  _✓w_✓i_✓n_✓d_✓o_✓w  coordinates.   Whether
  836.       that  is _✓r_✓e_✓l_✓a_✓t_✓i_✓v_✓e (i.e. 0-999) or _✓a_✓b_✓s_✓o_✓l_✓u_✓t_✓e depends upon the current coor-
  837.       dinate setting of the window.   As  with  (  X✓X✓X✓X,Y✓Y✓Y✓Y)  above,  the  modifiers
  838.       s✓s✓s✓sr✓r✓r✓rc✓c✓c✓c,d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,1✓1✓1✓1,  and  2✓2✓2✓2  refer respectively to the _✓s_✓o_✓u_✓r_✓c_✓e, _✓d_✓e_✓s_✓t_✓i_✓n_✓a_✓t_✓i_✓o_✓n, _✓f_✓i_✓r_✓s_✓t,
  839.       and _✓s_✓e_✓c_✓o_✓n_✓d coordinates.
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  MGR-C Language Application Interface- 11 -                          Macros
  863.  
  864.  
  865.  => _✓M_✓a_✓c_✓r_✓o_✓s
  866.  
  867.  All of the C library interface macros expand into _✓p_✓r_✓i_✓n_✓t_✓f expressions that con-
  868.  vert  their  command specification into the MGR stream protocol.  Compile time
  869.  and run time options are available that globally alter the behavior  of  these
  870.  macros  to the specific needs of the client program.  The options are detailed
  871.  in the _✓U_✓s_✓i_✓n_✓g _✓t_✓h_✓e _✓L_✓i_✓b_✓r_✓a_✓r_✓y section of this document. The returned value  of  the
  872.  macro  expressions  are  not meaningful.  The macros described here attempt to
  873.  reflect the actual state of the system, and may include  some  inconsistencies
  874.  that  should be cleaned up in future releases of the software.  Every MGR com-
  875.  mand (a command identifier - argument count combination) that is  accepted  by
  876.  MGR has a macro describing its function.
  877.  
  878.  
  879.  m_addchar()
  880.       Inserts a space character at the current character cursor position.   The
  881.       remaining characters on the line, if any, are shifted to the right.
  882.  
  883.  m_addchars( n✓n✓n✓n)
  884.       Inserts n✓n✓n✓n space characters at the current character cursor position.  The
  885.       remaining characters on the line, if any, are shifted to the right.
  886.  
  887.  m_addline()
  888.       Inserts a blank line at current row. The current row, and any  below  it,
  889.       are  shifted  down one line.  The bottom line of text is scrolled off the
  890.       window.
  891.  
  892.  m_addlines( n✓n✓n✓n)
  893.       Inserts n✓n✓n✓n blank lines at current row. The current row, and any  below  it
  894.       are  shifted  down.  The bottom n✓n✓n✓n lines of text are scrolled off the win-
  895.       dow.  It is much more efficient to call m_addlines( n✓n✓n✓n) once, than  it  is
  896.       to call m_addline()n✓n✓n✓n times.
  897.  
  898.  m_aligntext()
  899.       Moves the current character cursor coincident with the  current  graphics
  900.       point.   The current graphics point is set with m_go( x✓x✓x✓x,y✓y✓y✓y).  This permits
  901.       client programs to position characters at arbitrary  pixel  locations  on
  902.       the window.
  903.  
  904.  m_arc( x✓x✓x✓x,y✓y✓y✓y,x✓x✓x✓x1✓1✓1✓1,y✓y✓y✓y1✓1✓1✓1,x✓x✓x✓x2✓2✓2✓2,y✓y✓y✓y2✓2✓2✓2)
  905.       An arc centered at ( x✓x✓x✓x,y✓y✓y✓y)is drawn counter clockwise  from  (  x✓x✓x✓x1✓1✓1✓1,y✓y✓y✓y1✓1✓1✓1)to  (
  906.       x✓x✓x✓x2✓2✓2✓2,y✓y✓y✓y2✓2✓2✓2)using the current drawing function (see m_func()).
  907.  
  908.  m_bell()
  909.       The window flashes and the bell, if there is one,  rings.   Even  if  the
  910.       window is totally obscured, its flashing is made visible to the user.
  911.  
  912.  m_bcolor( c✓c✓c✓co✓o✓o✓ol✓l✓l✓lo✓o✓o✓or✓r✓r✓r)
  913.       The background color for text operations is set to  c✓c✓c✓co✓o✓o✓ol✓l✓l✓lo✓o✓o✓or✓r✓r✓r,  which  is  an
  914.       index  into  the  color lookup table.  This command is ignored on a mono-
  915.       chrome display.  See also m_fcolor()and m_linecolor().
  916.  
  917.  m_bitcopy( x✓x✓x✓x_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,y✓y✓y✓y_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e,h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h,x✓x✓x✓x_✓_✓_✓_s✓s✓s✓sr✓r✓r✓rc✓c✓c✓c,y✓y✓y✓y_✓_✓_✓_s✓s✓s✓sr✓r✓r✓rc✓c✓c✓c)
  918.       Copy a rectangle from one place on the window to another  with  the  copy
  919.  
  920.  
  921.  
  922.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  MGR-C Language Application Interface- 12 -                          Macros
  929.  
  930.  
  931.       function  set  by m_func( n✓n✓n✓n). The rectangular area at x✓x✓x✓x_✓_✓_✓_s✓s✓s✓sr✓r✓r✓rc✓c✓c✓c,y✓y✓y✓y_✓_✓_✓_s✓s✓s✓sr✓r✓r✓rc✓c✓c✓c of size
  932.       w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e by h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h is combined with the rectangle at x✓x✓x✓x_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,y✓y✓y✓y_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t  according  to
  933.       the  last function set by m_func().  The resultant rectangle is placed at
  934.       x✓x✓x✓x_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,y✓y✓y✓y_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t.
  935.  
  936.  m_bitcopyto( x✓x✓x✓x_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,y✓y✓y✓y_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e,h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h,x✓x✓x✓x_✓_✓_✓_s✓s✓s✓sr✓r✓r✓rc✓c✓c✓c,y✓y✓y✓y_✓_✓_✓_s✓s✓s✓sr✓r✓r✓rc✓c✓c✓c,t✓t✓t✓to✓o✓o✓o,f✓f✓f✓fr✓r✓r✓ro✓o✓o✓om✓m✓m✓m)
  937.       Combine the rectangle at position x✓x✓x✓x_✓_✓_✓_s✓s✓s✓sr✓r✓r✓rc✓c✓c✓c,y✓y✓y✓y_✓_✓_✓_s✓s✓s✓sr✓r✓r✓rc✓c✓c✓c of size  w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e  by  h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h  of
  938.       bitmap  f✓f✓f✓fr✓r✓r✓ro✓o✓o✓om✓m✓m✓m with the rectangle of the same size at x✓x✓x✓x_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,y✓y✓y✓y_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t of bitmap
  939.       t✓t✓t✓to✓o✓o✓o.  The bit-blt function used to combine the two rectangles  is  set  by
  940.       m_func().   F✓F✓F✓Fr✓r✓r✓ro✓o✓o✓om✓m✓m✓m  and  t✓t✓t✓to✓o✓o✓o are scratch-pad bitmap descriptors.  Scratchpad
  941.       bitmap 0 (zero) represents the current window contents and  may  be  used
  942.       for  the  source , destination or both.  If the scratchpad bitmap t✓t✓t✓to✓o✓o✓o does
  943.       not already exist, it is created with a size of w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e+x✓x✓x✓x_✓_✓_✓_s✓s✓s✓sr✓r✓r✓rc✓c✓c✓c by h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h+y✓y✓y✓y_✓_✓_✓_s✓s✓s✓sr✓r✓r✓rc✓c✓c✓c.
  944.  
  945.  m_bitcreate( n✓n✓n✓n,w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e,h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h)
  946.       Create the scratchpad bitmap n✓n✓n✓n of size w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e by h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h.  The contents of the
  947.       bitmap are undefined.  The macro m_bitwriteto() can be used to initialize
  948.       the scratchpad bitmap.  If the bitmap already  exists,  the  old  one  is
  949.       first  discarded.   Scratchpad  bitmaps may also be created implicitly by
  950.       specifying a non-existent bitmap as the  destination  of  m_bitwriteto(),
  951.       m_bitcopyto(), m_bitld(), or m_stringto().
  952.  
  953.  m_bitdestroy( n✓n✓n✓n)
  954.       Destroys scratchpad bitmap n✓n✓n✓n and frees all the resources associated  with
  955.       it.  If n✓n✓n✓n does not exist, this macro is ignored.
  956.  
  957.  m_bitfromfile( t✓t✓t✓to✓o✓o✓o,n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e)
  958.       Copy the file n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e on the _✓M_✓G_✓R-_✓h_✓o_✓s_✓t machine into the scratchpad bitmap t✓t✓t✓to✓o✓o✓o.
  959.       The  scratchpad  bitmap  t✓t✓t✓to✓o✓o✓o is created if it does not already exist.  _✓M_✓G_✓R
  960.       returns  a single line containing the _✓w_✓i_✓d_✓t_✓h and _✓h_✓e_✓i_✓g_✓h_✓t of the bitmap,  or
  961.       a _✓b_✓l_✓a_✓n_✓k if the file could not be found or loaded.  If n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e does not start
  962.       with / or ./, The file n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e is prefixed with  MGR's  home  directory  and
  963.       /_✓i_✓c_✓o_✓n/.   N✓N✓N✓Na✓a✓a✓am✓m✓m✓me✓e✓e✓es  starting with ./ are evaluated relative to the directory
  964.       current when _✓M_✓G_✓R was invoked.  The format of the bitmap file is described
  965.       in _✓d_✓u_✓m_✓p._✓h.
  966.  
  967.  m_bitget( f✓f✓f✓fr✓r✓r✓ro✓o✓o✓om✓m✓m✓m,s✓s✓s✓si✓i✓i✓iz✓z✓z✓ze✓e✓e✓e,o✓o✓o✓of✓f✓f✓ff✓f✓f✓fs✓s✓s✓se✓e✓e✓et✓t✓t✓t)
  968.       Upload part of a _✓s_✓c_✓r_✓a_✓t_✓c_✓h_✓p_✓a_✓d bitmap.   S✓S✓S✓Si✓i✓i✓iz✓z✓z✓ze✓e✓e✓e  bytes  of  _✓s_✓c_✓r_✓a_✓t_✓c_✓h_✓p_✓a_✓d  bitmap
  969.       f✓f✓f✓fr✓r✓r✓ro✓o✓o✓om✓m✓m✓m,  starting o✓o✓o✓of✓f✓f✓ff✓f✓f✓fs✓s✓s✓se✓e✓e✓et✓t✓t✓t bytes from the beginning of the bitmap are sent to
  970.       the client program from _✓M_✓G_✓R.  After this call, the client is expected  to
  971.       read  s✓s✓s✓si✓i✓i✓iz✓z✓z✓ze✓e✓e✓e bytes from the input stream.  The image data is sent in raster
  972.       scan order, 8 pixels to a byte, padded at the right of every line  to  16
  973.       bits.   S✓S✓S✓Si✓i✓i✓iz✓z✓z✓ze✓e✓e✓e  should  be  kept small (about 80 bytes), to avoid potential
  974.       flow control problems, with bitmaps uploaded  in  multiple  passes.  (See
  975.       also m_bitsave()).  The data sent by MGR for this macro requires an eight
  976.       bit data channel, so its use is discouraged.  The  macro  m_bitfromfile()
  977.       should be used instead when possible.
  978.  
  979.  m_bitld( w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e,h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h,x✓x✓x✓x,y✓y✓y✓y,s✓s✓s✓si✓i✓i✓iz✓z✓z✓ze✓e✓e✓e)
  980.       Prepare MGR to download a bitmap to the window.  This macro instructs MGR
  981.       that  the  next s✓s✓s✓si✓i✓i✓iz✓z✓z✓ze✓e✓e✓e bytes received will be interpreted as a bitmap image
  982.       to be displayed on the window starting at location ( x✓x✓x✓x,y✓y✓y✓y),  and  of  size
  983.       w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e  by h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h.  Downloading bitmaps requires an eight bit channel between
  984.       MGR and the client program.  Large  bitmaps  are  best  sent  in  several
  985.  
  986.  
  987.  
  988.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  MGR-C Language Application Interface- 13 -                          Macros
  995.  
  996.  
  997.       pieces.  The macro m_bitfromfile()should be used instead, where possible,
  998.       as it only requires a seven bit data channel and avoids the  movement  of
  999.       large  amounts  of data through the channel.  If more bytes are specified
  1000.       than required by the size of the bitmap,  they  are  discarded.   If  the
  1001.       number  specified  by s✓s✓s✓si✓i✓i✓iz✓z✓z✓ze✓e✓e✓e is insufficient to fill the entire bitmap, the
  1002.       remainder of the bits are set to undetermined values.
  1003.  
  1004.  m_bitldto( w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e,h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h,x✓x✓x✓x_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,y✓y✓y✓y_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,t✓t✓t✓to✓o✓o✓o,s✓s✓s✓si✓i✓i✓iz✓z✓z✓ze✓e✓e✓e)
  1005.       Prepare to download a bitmap to the scratchpad bitmap t✓t✓t✓to✓o✓o✓o.  If t✓t✓t✓to✓o✓o✓o does not
  1006.       already exist, (see m_bitcreate()), it is created automatically with size
  1007.       w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e by h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h.  This function instructs  MGR  that  the  next  s✓s✓s✓si✓i✓i✓iz✓z✓z✓ze✓e✓e✓e  bytes
  1008.       received will be interpreted as a bitmap image to be copied to scratchpad
  1009.       bitmap t✓t✓t✓to✓o✓o✓o at location x✓x✓x✓x_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,y✓y✓y✓y_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t.  This function requires an  eight  bit
  1010.       channel  between MGR and the client program.  If more bytes are specified
  1011.       than required by the size of the bitmap,  they  are  discarded.   If  the
  1012.       number  specified  by s✓s✓s✓si✓i✓i✓iz✓z✓z✓ze✓e✓e✓e is insufficient to fill the entire bitmap, the
  1013.       remainder of the bits are set to undetermined values.
  1014.  
  1015.  m_bitsave( f✓f✓f✓fr✓r✓r✓ro✓o✓o✓om✓m✓m✓m,n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e)
  1016.       Save a scratchpad bitmap f✓f✓f✓fr✓r✓r✓ro✓o✓o✓om✓m✓m✓m on the file n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e on the _✓M_✓G_✓R-_✓h_✓o_✓s_✓t file  sys-
  1017.       tem.   If  n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e  does not start with / or ./, n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e is prefixed with MGR's
  1018.       home directory and /_✓i_✓c_✓o_✓n/.  N✓N✓N✓Na✓a✓a✓am✓m✓m✓me✓e✓e✓es starting with ./ are evaluated relative
  1019.       to  the  directory current when _✓M_✓G_✓R was invoked.  Specifying f✓f✓f✓fr✓r✓r✓ro✓o✓o✓om✓m✓m✓m to be 0✓0✓0✓0
  1020.       (zero) saves the entire display contents  to  the  file.   The  functions
  1021.       m_windowsave() and m_othersave() are used to save contents of entire win-
  1022.       dows.
  1023.  
  1024.  m_bitwrite( x✓x✓x✓x_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,y✓y✓y✓y_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e,h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h)
  1025.       The rectangular region of the window, starting at x✓x✓x✓x_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,y✓y✓y✓y_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t  of  extent
  1026.       w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e  by  h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h, is set, cleared or inverted as determined by the previous
  1027.       call to m_func().
  1028.  
  1029.  m_bitwriteto( x✓x✓x✓x_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,y✓y✓y✓y_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e,h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h,t✓t✓t✓to✓o✓o✓o)
  1030.       The rectangular region of _✓s_✓c_✓r_✓a_✓t_✓c_✓h_✓p_✓a_✓d bitmap t✓t✓t✓to✓o✓o✓o, starting  at  x✓x✓x✓x_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,y✓y✓y✓y_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t
  1031.       of  extent w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e by h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h, is set, cleared or inverted as determined by the
  1032.       previous call to m_func().  If the destination t✓t✓t✓to✓o✓o✓o does not exist,  it  is
  1033.       created with the dimensions w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e by h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h.
  1034.  
  1035.  m_broadcast( s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g)
  1036.       The message s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g is  broadcast  to  all  windows  that  are  _✓l_✓i_✓s_✓t_✓e_✓ning.
  1037.       _✓L_✓i_✓s_✓t_✓e_✓ning  is  turned  on by setting the A✓A✓A✓AC✓C✓C✓CC✓C✓C✓CE✓E✓E✓EP✓P✓P✓PT✓T✓T✓T event for a window.  (See
  1038.       m_setevent()).  Messages can only be sent to  windows  whose  controlling
  1039.       terminals  have  general  write permission disabled (i.e. mode 0400) as a
  1040.       security measure to prevent  malicious  foreign  processes  from  sending
  1041.       _✓s_✓h_✓e_✓l_✓ls messages that get interpreted and executed as commands.
  1042.  
  1043.  m_circle( x✓x✓x✓x_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,y✓y✓y✓y_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s)
  1044.       A circle of radius r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s is drawn, centered at x✓x✓x✓x_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,y✓y✓y✓y_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t.  The  points
  1045.       at the edge of the circle are set, cleared or inverted depending upon the
  1046.       last call to m_func().  Circles are never scaled, they always  appear  as
  1047.       circles  on  the  display, regardless of the window shape.  The r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s is
  1048.       scaled based upon the average  w✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h  and  h✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t  of  the  window.   Use
  1049.       m_ellipse()to obtain a scaled circle.
  1050.  
  1051.  
  1052.  
  1053.  
  1054.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  MGR-C Language Application Interface- 14 -                          Macros
  1061.  
  1062.  
  1063.  m_clear()
  1064.       The current _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n is cleared, and the character cursor is moved  to
  1065.       position  (  0✓0✓0✓0,0✓0✓0✓0).  If no _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n is set, m_clear() clears the entire
  1066.       window.
  1067.  
  1068.  m_cleareol()
  1069.       All of the characters on the current  line,  starting  with  the  current
  1070.       character  to the end of the _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n, are cleared.  If no _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n
  1071.       is set, m_cleareol() clears to the edge of the window.
  1072.  
  1073.  m_cleareos()
  1074.       All of the characters in the current _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n, from the current  char-
  1075.       acter  to  the end of the _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n, are cleared.  If no _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n is
  1076.       set, m_clear() clears to the end of the window.
  1077.  
  1078.  m_clearevent( n✓n✓n✓n)
  1079.       Event n✓n✓n✓n is cleared.  The integer n✓n✓n✓n is one of: A✓A✓A✓AC✓C✓C✓CC✓C✓C✓CE✓E✓E✓EP✓P✓P✓PT✓T✓T✓T, A✓A✓A✓AC✓C✓C✓CT✓T✓T✓TI✓I✓I✓IV✓V✓V✓VA✓A✓A✓AT✓T✓T✓TE✓E✓E✓E, B✓B✓B✓BU✓U✓U✓UT✓T✓T✓TT✓T✓T✓TO✓O✓O✓ON✓N✓N✓N_✓_✓_✓_1✓1✓1✓1,
  1080.       B✓B✓B✓BU✓U✓U✓UT✓T✓T✓TT✓T✓T✓TO✓O✓O✓ON✓N✓N✓N_✓_✓_✓_1✓1✓1✓1U✓U✓U✓U,  B✓B✓B✓BU✓U✓U✓UT✓T✓T✓TT✓T✓T✓TO✓O✓O✓ON✓N✓N✓N_✓_✓_✓_2✓2✓2✓2,  B✓B✓B✓BU✓U✓U✓UT✓T✓T✓TT✓T✓T✓TO✓O✓O✓ON✓N✓N✓N_✓_✓_✓_2✓2✓2✓2U✓U✓U✓U,  C✓C✓C✓CO✓O✓O✓OV✓V✓V✓VE✓E✓E✓ER✓R✓R✓RE✓E✓E✓ED✓D✓D✓D,  D✓D✓D✓DE✓E✓E✓EA✓A✓A✓AC✓C✓C✓CT✓T✓T✓TI✓I✓I✓IV✓V✓V✓VA✓A✓A✓AT✓T✓T✓TE✓E✓E✓E,  D✓D✓D✓DE✓E✓E✓ES✓S✓S✓ST✓T✓T✓TR✓R✓R✓RO✓O✓O✓OY✓Y✓Y✓Y,  M✓M✓M✓MO✓O✓O✓OV✓V✓V✓VE✓E✓E✓E,
  1081.       N✓N✓N✓NO✓O✓O✓OT✓T✓T✓TI✓I✓I✓IF✓F✓F✓FY✓Y✓Y✓Y, P✓P✓P✓PA✓A✓A✓AS✓S✓S✓ST✓T✓T✓TE✓E✓E✓E,  R✓R✓R✓RE✓E✓E✓ED✓D✓D✓DR✓R✓R✓RA✓A✓A✓AW✓W✓W✓W,  R✓R✓R✓RE✓E✓E✓ES✓S✓S✓SH✓H✓H✓HA✓A✓A✓AP✓P✓P✓PE✓E✓E✓E,  S✓S✓S✓SN✓N✓N✓NA✓A✓A✓AR✓R✓R✓RF✓F✓F✓FE✓E✓E✓ED✓D✓D✓D,✓,✓,✓,  S✓S✓S✓ST✓T✓T✓TA✓A✓A✓AC✓C✓C✓CK✓K✓K✓K,  or  U✓U✓U✓UN✓N✓N✓NC✓C✓C✓CO✓O✓O✓OV✓V✓V✓VE✓E✓E✓ER✓R✓R✓RE✓E✓E✓ED✓D✓D✓D.   See
  1082.       m_setevent() for a description of the events.
  1083.  
  1084.  m_clearmenu( n✓n✓n✓n)
  1085.       If menu n✓n✓n✓n exists, it is cleared.
  1086.  
  1087.  m_clearmode( m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e)
  1088.       Clear one of the following window modes.  Except where noted,  these  are
  1089.       the  default  settings.   The  mode  settings are more fully explained in
  1090.       m_setmode().
  1091.  
  1092.       M✓M✓M✓M_✓_✓_✓_A✓A✓A✓AB✓B✓B✓BS✓S✓S✓S
  1093.            _✓A_✓b_✓s_✓o_✓l_✓u_✓t_✓e window coordinate mode is turned off.  The window is now in
  1094.            _✓r_✓e_✓l_✓a_✓t_✓i_✓v_✓e  window  coordinates.  All  window coordinates range from (
  1095.            0✓0✓0✓0,0✓0✓0✓0) in the upper left corner to ( 9✓9✓9✓99✓9✓9✓99✓9✓9✓9,9✓9✓9✓99✓9✓9✓99✓9✓9✓9) at the lower right.
  1096.  
  1097.       M✓M✓M✓M_✓_✓_✓_A✓A✓A✓AC✓C✓C✓CT✓T✓T✓TI✓I✓I✓IV✓V✓V✓VA✓A✓A✓AT✓T✓T✓TE✓E✓E✓E
  1098.            Bury the window. Unlike the other window modes, _✓b_✓u_✓r_✓y  has  no  state
  1099.            associated  with  it, just a one time action.  A window is buried by
  1100.            visually pushing it to the bottom of the display; any window  inter-
  1101.            secting it will appear in front of it.
  1102.  
  1103.       M✓M✓M✓M_✓_✓_✓_A✓A✓A✓AU✓U✓U✓UT✓T✓T✓TO✓O✓O✓OE✓E✓E✓EX✓X✓X✓XP✓P✓P✓PO✓O✓O✓OS✓S✓S✓SE✓E✓E✓E
  1104.            Do not automatically activate the window the next time  it  receives
  1105.            output.
  1106.  
  1107.       M✓M✓M✓M_✓_✓_✓_B✓B✓B✓BA✓A✓A✓AC✓C✓C✓CK✓K✓K✓KG✓G✓G✓GR✓R✓R✓RO✓O✓O✓OU✓U✓U✓UN✓N✓N✓ND✓D✓D✓D
  1108.            MGR does not permit the window to  update  if  it  is  partially  or
  1109.            totally  obscured.   Data  destined for the window is held until the
  1110.            window is uncovered, or _✓M__✓B_✓A_✓C_✓K_✓G_✓R_✓O_✓U_✓N_✓D is turned on.
  1111.  
  1112.       M✓M✓M✓M_✓_✓_✓_N✓N✓N✓NO✓O✓O✓OI✓I✓I✓IN✓N✓N✓NP✓P✓P✓PU✓U✓U✓UT✓T✓T✓T
  1113.            Accept keyboard input if the window is active.
  1114.  
  1115.       M✓M✓M✓M_✓_✓_✓_N✓N✓N✓NO✓O✓O✓OW✓W✓W✓WR✓R✓R✓RA✓A✓A✓AP✓P✓P✓P
  1116.            Wrap the character cursor to the next line when it reaches the right
  1117.  
  1118.  
  1119.  
  1120.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  MGR-C Language Application Interface- 15 -                          Macros
  1127.  
  1128.  
  1129.            margin of the _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n.
  1130.  
  1131.       M✓M✓M✓M_✓_✓_✓_O✓O✓O✓OV✓V✓V✓VE✓E✓E✓ER✓R✓R✓RS✓S✓S✓ST✓T✓T✓TR✓R✓R✓RI✓I✓I✓IK✓K✓K✓KE✓E✓E✓E
  1132.            Do not overstrike characters.  Text is copied to the  window  as  if
  1133.            m_func( B✓B✓B✓B_✓_✓_✓_S✓S✓S✓SR✓R✓R✓RC✓C✓C✓C) is set.
  1134.  
  1135.       M✓M✓M✓M_✓_✓_✓_S✓S✓S✓SN✓N✓N✓NA✓A✓A✓AR✓R✓R✓RF✓F✓F✓FH✓H✓H✓HA✓A✓A✓AR✓R✓R✓RD✓D✓D✓D
  1136.            The system _✓c_✓u_✓t function fails if any errors are found. This is indi-
  1137.            cated  by  flashing  the window.  The contents of the _✓c_✓u_✓t buffer are
  1138.            left undisturbed.   Normally  this  only  happens  if  some  process
  1139.            unknown to MGR scribbles into the region being cut.
  1140.  
  1141.       M✓M✓M✓M_✓_✓_✓_S✓S✓S✓SN✓N✓N✓NA✓A✓A✓AR✓R✓R✓RF✓F✓F✓FL✓L✓L✓LI✓I✓I✓IN✓N✓N✓NE✓E✓E✓ES✓S✓S✓S
  1142.            Sets the system _✓c_✓u_✓t function to cut individual  characters,  instead
  1143.            of entire lines only.
  1144.  
  1145.       M✓M✓M✓M_✓_✓_✓_S✓S✓S✓SN✓N✓N✓NA✓A✓A✓AR✓R✓R✓RF✓F✓F✓FT✓T✓T✓TA✓A✓A✓AB✓B✓B✓BS✓S✓S✓S
  1146.            The system _✓c_✓u_✓t function cuts text exactly as it appears on the  win-
  1147.            dow.   All interior white space is converted to _✓s_✓p_✓a_✓c_✓es, all trailing
  1148.            white space is treated as a _✓n_✓e_✓w _✓l_✓i_✓n_✓e.
  1149.  
  1150.       M✓M✓M✓M_✓_✓_✓_S✓S✓S✓ST✓T✓T✓TA✓A✓A✓AC✓C✓C✓CK✓K✓K✓K
  1151.            Event stacking is turned off.  Event strings are only  returned  for
  1152.            the  current  window  context  and not for any contexts stacked with
  1153.            m_push().
  1154.  
  1155.       M✓M✓M✓M_✓_✓_✓_S✓S✓S✓ST✓T✓T✓TA✓A✓A✓AN✓N✓N✓ND✓D✓D✓DO✓O✓O✓OU✓U✓U✓UT✓T✓T✓T
  1156.            Characters are drawn in black with a white background.
  1157.  
  1158.       M✓M✓M✓M_✓_✓_✓_W✓W✓W✓WO✓O✓O✓OB✓B✓B✓B
  1159.            The window foreground color is set to _✓b_✓l_✓a_✓c_✓k, and  the  window  back-
  1160.            ground is set color to _✓w_✓h_✓i_✓t_✓e.
  1161.  
  1162.       M✓M✓M✓M_✓_✓_✓_D✓D✓D✓DU✓U✓U✓UP✓P✓P✓PK✓K✓K✓KE✓E✓E✓EY✓Y✓Y✓Y
  1163.            The keyboard escape character is turned off.  This mode is turned on
  1164.            by   calling   m_dupkey().    There  is  no  corresponding  call  to
  1165.            m_setmode().
  1166.  
  1167.  m_deletechar()
  1168.       The character at the cursor position is deleted.  Any characters  on  the
  1169.       line  to the right of the cursor are shifted left one character position.
  1170.       The last character on the line is set to a _✓s_✓p_✓a_✓c_✓e.
  1171.  
  1172.  m_deletechars( n✓n✓n✓n)
  1173.       The next n✓n✓n✓n characters are deleted, starting at the character cursor posi-
  1174.       tion.   Any characters on the line to the right of the cursor are shifted
  1175.       left n✓n✓n✓n character positions.  The last n✓n✓n✓n characters on the line are set to
  1176.       _✓s_✓p_✓a_✓c_✓e.
  1177.  
  1178.  m_deleteline()
  1179.       The line at the cursor position is deleted.  Any lines below  the  cursor
  1180.       are shifted up one line.  The last line is cleared.
  1181.  
  1182.  m_deletelines( n✓n✓n✓n)
  1183.  
  1184.  
  1185.  
  1186.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  MGR-C Language Application Interface- 16 -                          Macros
  1193.  
  1194.  
  1195.       The next n✓n✓n✓n lines starting at the cursor position and toward the bottom of
  1196.       the  window are deleted.  Any lines below the deleted ones are shifted up
  1197.       n✓n✓n✓n lines.  The last n✓n✓n✓n lines are cleared.  It is more efficient to make one
  1198.       call to m_deletelines() than to call m_deleteline()n✓n✓n✓n times.
  1199.  
  1200.  m_destroywin( n✓n✓n✓n)
  1201.       Destroy alternate window n✓n✓n✓n, created by calling m_newwin().  If output  is
  1202.       currently directed to this window, it is automatically re-directed to the
  1203.       _✓m_✓a_✓i_✓n window.  See also m_selectwin().
  1204.  
  1205.  m_down( n✓n✓n✓n)
  1206.       Move the character cursor down n✓n✓n✓n tenths of a character height.  This  may
  1207.       cause the window to scroll.  See also m_left()m_right()and m_up().
  1208.  
  1209.  m_draw( x✓x✓x✓x,y✓y✓y✓y)
  1210.       Draw a line from current _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s _✓p_✓o_✓i_✓n_✓t to ( x✓x✓x✓x,y✓y✓y✓y).  The macro  m_go()  is
  1211.       used  to  move the _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s _✓p_✓o_✓i_✓n_✓t.  The _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s _✓p_✓o_✓i_✓n_✓t is left at ( x✓x✓x✓x,y✓y✓y✓y),
  1212.       the end point of the line.
  1213.  
  1214.  m_dupkey( c✓c✓c✓ch✓h✓h✓ha✓a✓a✓ar✓r✓r✓r)
  1215.       Every time the character c✓c✓c✓ch✓h✓h✓ha✓a✓a✓ar✓r✓r✓r is typed at the keyboard for  this  window,
  1216.       it is sent to the client program twice.  This enables clients to reliably
  1217.       distinguish keyboard input from that  generated  by  menu  selections  or
  1218.       events  by starting every _✓e_✓v_✓e_✓n_✓t and _✓m_✓e_✓n_✓u string with a two character code
  1219.       whose first character is c✓c✓c✓ch✓h✓h✓ha✓a✓a✓ar✓r✓r✓r and whose second character is anything  but
  1220.       c✓c✓c✓ch✓h✓h✓ha✓a✓a✓ar✓r✓r✓r.
  1221.  
  1222.  m_ellipse( x✓x✓x✓x,y✓y✓y✓y,r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s1✓1✓1✓1,r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s2✓2✓2✓2)
  1223.       Draw an ellipse centered at ( x✓x✓x✓x,y✓y✓y✓y).  The values for r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s1✓1✓1✓1  and  r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s2✓2✓2✓2
  1224.       are  the  major and minor axis radii.  The ellipse is either set, cleared
  1225.       or inverted determined by the last call  to  m_func().   The  values  for
  1226.       r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s1✓1✓1✓1 and r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s2✓2✓2✓2 are scaled based upon the average width and height of
  1227.       the window.
  1228.  
  1229.  m_ellipseto( t✓t✓t✓to✓o✓o✓o,x✓x✓x✓x,y✓y✓y✓y,r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s1✓1✓1✓1,r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s2✓2✓2✓2)
  1230.       Draw an ellipse  on  scratchpad  bitmap  t✓t✓t✓to✓o✓o✓o  centered  at  (  x✓x✓x✓x,y✓y✓y✓y)  where
  1231.       r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s1✓1✓1✓1,r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s2✓2✓2✓2  are  the  major  and  minor  axis radii.  The ellipse is
  1232.       either set, cleared or inverted determined by the last call to  m_func().
  1233.       The  values  for  r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s1✓1✓1✓1  and  r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s2✓2✓2✓2 are scaled based upon the average
  1234.       w✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h and h✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t of the window.  If the  offscreen  bitmap  t✓t✓t✓to✓o✓o✓o  does  not
  1235.       exist, this call is ignored.
  1236.  
  1237.  m_fastdraw( x✓x✓x✓x,y✓y✓y✓y,c✓c✓c✓co✓o✓o✓ou✓u✓u✓un✓n✓n✓nt✓t✓t✓t,d✓d✓d✓da✓a✓a✓at✓t✓t✓ta✓a✓a✓a)
  1238.       The next c✓c✓c✓co✓o✓o✓ou✓u✓u✓un✓n✓n✓nt✓t✓t✓t bytes of d✓d✓d✓da✓a✓a✓at✓t✓t✓ta✓a✓a✓a are sent to MGR are  to  be  interpreted  as
  1239.       lines  drawn  in _✓f_✓a_✓s_✓t _✓d_✓r_✓a_✓w mode, starting at ( x✓x✓x✓x,y✓y✓y✓y).  _✓F_✓a_✓s_✓t _✓d_✓r_✓a_✓w mode per-
  1240.       mits the rapid drawing of short vectors by encoding an  _✓x,_✓y  displacement
  1241.       location  in  a  single  byte.  The _✓x coordinate is contained in the most
  1242.       significant 4 bits, the _✓y coordinate in the  least  significant  4  bits.
  1243.       Values  for  _✓x  and _✓y represent displacements from the previous location,
  1244.       and range from +7 to -8.  A 7 is coded as _✓0_✓x_✓f_✓f, a -8 as _✓0_✓x_✓0_✓0.  If both  _✓x
  1245.       and _✓y are zero (i.e.  _✓0_✓x_✓8_✓0_✓8_✓0).  The next coordinate is taken to be a _✓m_✓o_✓v_✓e
  1246.       instead of a _✓d_✓r_✓a_✓w.  An eight bit channel between MGR and the client  pro-
  1247.       gram is required for _✓f_✓a_✓s_✓t _✓d_✓r_✓a_✓w mode.  See also m_rfastdraw().
  1248.  
  1249.  
  1250.  
  1251.  
  1252.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  MGR-C Language Application Interface- 17 -                          Macros
  1259.  
  1260.  
  1261.  m_fcolor( c✓c✓c✓co✓o✓o✓ol✓l✓l✓lo✓o✓o✓or✓r✓r✓r)
  1262.       The foreground color for text operations is set to c✓c✓c✓co✓o✓o✓ol✓l✓l✓lo✓o✓o✓or✓r✓r✓r ,  which  is  an
  1263.       index  into  the  color lookup table.  This command is ignored on a mono-
  1264.       chrome display.  See also m_bcolor()and m_linecolor().
  1265.  
  1266.  m_flush()
  1267.       Flush the MGR output buffer.  This is equivalent to  the  stdio  function
  1268.       _✓f_✓f_✓l_✓u_✓s_✓h() and is needed only when the M✓M✓M✓M_✓_✓_✓_F✓F✓F✓FL✓L✓L✓LU✓U✓U✓US✓S✓S✓SH✓H✓H✓H flag is _✓n_✓o_✓t specified in the
  1269.       call to m_setup().
  1270.  
  1271.  m_font( n✓n✓n✓n)
  1272.       Change to font n✓n✓n✓n.  The line positioning is adjusted to keep the  baseline
  1273.       of  the  new  and  old  fonts  the same.  Font numbers are small integers
  1274.       (currently no more than 15).  Font 0 (zero) always refers to the built-in
  1275.       or  _✓d_✓e_✓f_✓a_✓u_✓l_✓t  font.  The actual fonts associated with the font numbers may
  1276.       be set in the MGR _✓s_✓t_✓a_✓r_✓t_✓u_✓p file, or changed by clients  on  the  fly  (see
  1277.       m_loadfont()).
  1278.  
  1279.  m_func( m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e)
  1280.       Set the drawing mode.  This specifies the drawing mode for  all  _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s
  1281.       and  _✓b_✓i_✓t-_✓b_✓l_✓t  operations.  The integer m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e is one of 16 possible boolean
  1282.       combinations of the _✓s_✓o_✓u_✓r_✓c_✓e and _✓d_✓e_✓s_✓t_✓i_✓n_✓a_✓t_✓i_✓o_✓n bit patterns.  Combinations of
  1283.       bit patterns for which there is no _✓s_✓o_✓u_✓r_✓c_✓e bitmap, such as m_bitwrite() or
  1284.       m_line() use the modes shown in the middle column of the following table.
  1285.       Several  common  m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓es  are  specified  for the bit patterns in which the
  1286.       source bitmap is relevent.
  1287.                        _______________________________________
  1288.                       |________N✓_a✓_m✓_e✓_s✓__f✓_o✓_r✓__b✓_✓b✓b✓bi✓_✓i✓i✓it✓_✓t✓t✓t-✓_✓-✓-✓-b✓_✓b✓b✓bl✓_✓l✓l✓lt✓_✓t✓t✓t_m✓_o✓_d✓_e✓_s✓_________✓|
  1289.                       |     source    |  no source|  comments|
  1290.                       |_✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓|✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓|✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓__✓|✓_
  1291.                       | B_OR          |  B_SET    |  default |
  1292.                       | B_COPY        |  B_CLEAR  |          |
  1293.                       | B_COPYINVERTED|  B_INVERT |          |
  1294.                       | B_XOR         |           |          |
  1295.                       | B_AND         |           |          |
  1296.                       |✓|________________✓|____________✓|___________✓|✓|
  1297.       Alternately, m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e may be derived with a boolean combination of B✓B✓B✓B_✓_✓_✓_S✓S✓S✓SR✓R✓R✓RC✓C✓C✓C  and
  1298.       B✓B✓B✓B_✓_✓_✓_D✓D✓D✓DS✓S✓S✓ST✓T✓T✓T,✓,✓,✓, thus B✓B✓B✓B_✓_✓_✓_O✓O✓O✓OR✓R✓R✓R is equivalent to (✓(✓(✓(B_SRC |✓|✓|✓| B_DST)✓)✓)✓).✓.✓.✓.
  1299.  
  1300.  m_getchar()
  1301.       The macro m_getchar()is equivalent to the _✓s_✓t_✓d_✓i_✓o routine _✓g_✓e_✓t_✓c_✓h_✓a_✓r(), except
  1302.       the character is retrieved from MGR via the file pointer _✓m__✓t_✓e_✓r_✓m_✓i_✓n instead
  1303.       of _✓s_✓t_✓d_✓i_✓n.
  1304.  
  1305.  m_gets( b✓b✓b✓bu✓u✓u✓uf✓f✓f✓ff✓f✓f✓f)
  1306.       A line of characters is read from MGR and placed into  b✓b✓b✓bu✓u✓u✓uf✓f✓f✓ff✓f✓f✓f.   The  macro
  1307.       m_gets()returns  _✓N_✓U_✓L_✓L  if  the  connection  to MGR is severed.  The macro
  1308.       m_gets()is equivalent to the stdio _✓f_✓g_✓e_✓t_✓s() call except input is retrieved
  1309.       from MGR.
  1310.  
  1311.  m_getinfo( m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e)
  1312.       This function requests MGR to return information back to the client  pro-
  1313.       gram.    M✓M✓M✓Mo✓o✓o✓od✓d✓d✓de✓e✓e✓e   specifies  one  of  (currently)  16  different  requests.
  1314.       Responses  are  always  terminated  with  a  _✓n_✓e_✓w  _✓l_✓i_✓n_✓e  for  single  line
  1315.  
  1316.  
  1317.  
  1318.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  MGR-C Language Application Interface- 18 -                          Macros
  1325.  
  1326.  
  1327.       responses, and with a pair of _✓n_✓e_✓w _✓l_✓i_✓n_✓e_✓s for multi-line responses.  Conse-
  1328.       quently, clients can request and process information requests using  nor-
  1329.       mal  line mode processing.  The following list of information requests is
  1330.       understood.
  1331.  
  1332.       G✓G✓G✓G_✓_✓_✓_A✓A✓A✓AL✓L✓L✓LL✓L✓L✓LM✓M✓M✓MI✓I✓I✓IN✓N✓N✓NE✓E✓E✓E
  1333.            Information about each window that may be written to by  the  client
  1334.            program  is  returned, one line of information per window, as a list
  1335.            of space separated items.  The first two items give the location  of
  1336.            the  top  left  corner  of  the  window in _✓d_✓i_✓s_✓p_✓l_✓a_✓y coordinates.  The
  1337.            second two items give the _✓h_✓e_✓i_✓g_✓h_✓t and _✓w_✓i_✓d_✓t_✓h of the  window,  also  in
  1338.            _✓d_✓i_✓s_✓p_✓l_✓a_✓y  coordinates.   The next field contains the last two charac-
  1339.            ters of the _✓p_✓s_✓e_✓u_✓d_✓otty associated with  each  window.   Normally  the
  1340.            _✓p_✓s_✓e_✓u_✓d_✓otty is the same for each window reported.  The next field con-
  1341.            tains the _✓w_✓i_✓n_✓d_✓o_✓w _✓i_✓d, which is 0 (zero) for the primary  window,  and
  1342.            the  value  returned by the call to m_makewindow()for the other win-
  1343.            dows (if any).  The final field contains the visual  status  of  the
  1344.            window,  which is either _✓C__✓E_✓X_✓P_✓O_✓S_✓E_✓D ('e') if the window is completely
  1345.            visible, or _✓C__✓O_✓B_✓S_✓C_✓U_✓R_✓E_✓D ('o') if the window is partly  or  completely
  1346.            obscured.   The window information is printed in order from _✓f_✓r_✓o_✓n_✓t to
  1347.            _✓b_✓a_✓c_✓k.  A sample line might look something like:
  1348.                                   ______________________
  1349.                                  |✓|_4✓_9✓_2✓__2✓__6✓_5✓_2✓__5✓_7✓_0✓__p✓_6✓__2✓__o✓__✓|✓|
  1350.            which indicates that the window at ( 4✓4✓4✓49✓9✓9✓92✓2✓2✓2,2✓2✓2✓2) is 6✓6✓6✓65✓5✓5✓52✓2✓2✓2 pixels  _✓w_✓i_✓d_✓e  and
  1351.            5✓5✓5✓57✓7✓7✓70✓0✓0✓0  pixels  _✓h_✓i_✓g_✓h,  has  a  controlling  _✓p_✓s_✓e_✓u_✓d_✓otty of /_✓d_✓e_✓v/_✓t_✓t_✓yp✓p✓p✓p6✓6✓6✓6, is
  1352.            alternate window number 2✓2✓2✓2,✓,✓,✓, and is at least partially obscured.
  1353.  
  1354.       G✓G✓G✓G_✓_✓_✓_A✓A✓A✓AL✓L✓L✓LL✓L✓L✓L
  1355.            Information about all windows is returned, one line  of  information
  1356.            per window, as a list of space separated items.  The first two items
  1357.            give the location of the top left corner of the  window  in  _✓d_✓i_✓s_✓p_✓l_✓a_✓y
  1358.            coordinates.   The second two items give the _✓h_✓e_✓i_✓g_✓h_✓t and _✓w_✓i_✓d_✓t_✓h of the
  1359.            window, also in _✓d_✓i_✓s_✓p_✓l_✓a_✓y coordinates.  The next  field  contains  the
  1360.            last  two  characters  of the _✓p_✓s_✓e_✓u_✓d_✓otty associated with each window.
  1361.            Normally the _✓p_✓s_✓e_✓u_✓d_✓otty is the same for each window controlled by the
  1362.            same  client.   The  next  field  contains the _✓w_✓i_✓n_✓d_✓o_✓w _✓i_✓d, which is 0
  1363.            (zero) for a primary window, and the value returned by the  call  to
  1364.            m_makewindow()for  alternate  windows.  The final field contains the
  1365.            visual status of the window, which is either _✓C__✓E_✓X_✓P_✓O_✓S_✓E_✓D ('e') if  the
  1366.            window  is  completely visible, or _✓C__✓O_✓B_✓S_✓C_✓U_✓R_✓E_✓D ('o') if the window is
  1367.            partly or completely obscured.  The window information for each win-
  1368.            dow  is  printed  in  order from _✓f_✓r_✓o_✓n_✓t to _✓b_✓a_✓c_✓k.  Thus the first line
  1369.            returned is currently the _✓a_✓c_✓t_✓i_✓v_✓e window.  A sample line  might  look
  1370.            something like:
  1371.                                   ______________________
  1372.                                  |✓|_4✓_9✓_2✓__2✓__6✓_5✓_2✓__5✓_7✓_0✓__p✓_6✓__0✓__o✓__✓|✓|
  1373.            Which indicates that the window at ( 4✓4✓4✓49✓9✓9✓92✓2✓2✓2,2✓2✓2✓2) is 6✓6✓6✓65✓5✓5✓52✓2✓2✓2 pixels  _✓w_✓i_✓d_✓e  and
  1374.            5✓5✓5✓57✓7✓7✓70✓0✓0✓0  pixels  _✓h_✓i_✓g_✓h,  has  a controlling _✓p_✓s_✓e_✓u_✓d_✓otty of /_✓d_✓e_✓v/_✓t_✓t_✓yp✓p✓p✓p6✓6✓6✓6, is a
  1375.            main window, and is at least partially obscured.
  1376.  
  1377.       G✓G✓G✓G_✓_✓_✓_C✓C✓C✓CO✓O✓O✓OO✓O✓O✓OR✓R✓R✓RD✓D✓D✓DS✓S✓S✓S
  1378.            A single line is returned containing the location and  size  of  the
  1379.            window  in  _✓d_✓i_✓s_✓p_✓l_✓a_✓y  coordinates.   The first pair of numbers is the
  1380.            position of the top left corner of the window, the  second  pair  of
  1381.  
  1382.  
  1383.  
  1384.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  MGR-C Language Application Interface- 19 -                          Macros
  1391.  
  1392.  
  1393.            numbers is the window's _✓w_✓i_✓d_✓t_✓h and _✓h_✓e_✓i_✓g_✓h_✓t in pixels.
  1394.  
  1395.       G✓G✓G✓G_✓_✓_✓_C✓C✓C✓CU✓U✓U✓UR✓R✓R✓RS✓S✓S✓SO✓O✓O✓OR✓R✓R✓R
  1396.            A single line is returned containing the position of  the  _✓c_✓h_✓a_✓r_✓a_✓c_✓t_✓e_✓r
  1397.            and  the  _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s cursor.  The first pair of numbers is the current
  1398.            _✓c_✓o_✓l_✓u_✓m_✓n and _✓r_✓o_✓w in character  coordinates  and  the  second  pair  of
  1399.            numbers  is the current _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓slocation in window coordinates.  The
  1400.            graphics cursor location is reported in either _✓a_✓b_✓s_✓o_✓l_✓u_✓t_✓e or  _✓r_✓e_✓l_✓a_✓t_✓i_✓v_✓e
  1401.            window  coordinates,  depending upon the window coordinate mode set-
  1402.            ting.
  1403.  
  1404.       G✓G✓G✓G_✓_✓_✓_F✓F✓F✓FO✓O✓O✓ON✓N✓N✓NT✓T✓T✓T
  1405.            A single line is returned which contains current  font  information.
  1406.            The first pair of numbers is the character _✓w_✓i_✓d_✓t_✓h and _✓h_✓e_✓i_✓g_✓h_✓t, in pix-
  1407.            els.  The next number is the _✓f_✓o_✓n_✓t _✓n_✓u_✓m_✓b_✓e_✓r as would be used in a  call
  1408.            to m✓m✓m✓m_✓_✓_✓_f✓f✓f✓fo✓o✓o✓on✓n✓n✓nt✓t✓t✓t, and the final field is the ascii name of the font.
  1409.  
  1410.       G✓G✓G✓G_✓_✓_✓_I✓I✓I✓ID✓D✓D✓D
  1411.            A single line is returned containing the window's  alternate  window
  1412.            id  ( 0 for the main window), followed by the number of windows con-
  1413.            trolled by the client program.
  1414.  
  1415.       G✓G✓G✓G_✓_✓_✓_M✓M✓M✓MO✓O✓O✓OU✓U✓U✓US✓S✓S✓SE✓E✓E✓E
  1416.            The mouse position, in _✓d_✓i_✓s_✓p_✓l_✓a_✓y coordinates are returned, followed by
  1417.            the  most  recent button transition, which is one of 1✓1✓1✓1,-✓-✓-✓-1✓1✓1✓1,2✓2✓2✓2,-✓-✓-✓-2✓2✓2✓2.  The
  1418.            numbers 1✓1✓1✓1 and 2✓2✓2✓2 represent buttons _✓o_✓n_✓e and _✓t_✓w_✓o on the  mouse  respec-
  1419.            tively.   The  third  mouse button is reserved for system use and is
  1420.            not accessible to client programs.  A negative value means the  but-
  1421.            ton  was  released;  a  positive value indicates the button is still
  1422.            depressed.
  1423.  
  1424.       G✓G✓G✓G_✓_✓_✓_M✓M✓M✓MO✓O✓O✓OU✓U✓U✓US✓S✓S✓SE✓E✓E✓E2✓2✓2✓2
  1425.            The mouse coordinates, in _✓w_✓i_✓n_✓d_✓o_✓w coordinates are returned,  followed
  1426.            by  the  most  recent  button transition, which is one of 1✓1✓1✓1,-✓-✓-✓-1✓1✓1✓1,2✓2✓2✓2,-✓-✓-✓-2✓2✓2✓2.
  1427.            The numbers 1✓1✓1✓1 and 2✓2✓2✓2 represent buttons _✓o_✓n_✓e and _✓t_✓w_✓o  respectively.   A
  1428.            negative  value means the button was last released; a positive value
  1429.            indicates the button is still depressed.  If the mouse is  above  or
  1430.            to  the left of the window, a negative coordinate value is returned.
  1431.            In addition if the window is in _✓r_✓e_✓l_✓a_✓t_✓i_✓v_✓e coordinate mode, coordinate
  1432.            values  between  0  and  999  will  be reported only if the mouse is
  1433.            within the window.
  1434.  
  1435.       G✓G✓G✓G_✓_✓_✓_S✓S✓S✓ST✓T✓T✓TA✓A✓A✓AT✓T✓T✓TU✓U✓U✓US✓S✓S✓S
  1436.            A line is returned containing a single character,  either  _✓C__✓E_✓X_✓P_✓O_✓S_✓E_✓D
  1437.            ('e'),  _✓C__✓O_✓B_✓S_✓C_✓U_✓R_✓E_✓D  ('o'),  or _✓C__✓A_✓C_✓T_✓I_✓V_✓E ('a') depending upon whether
  1438.            the window is exposed  but  not  the  _✓a_✓c_✓t_✓i_✓v_✓e  window,  partially  or
  1439.            totally obscured, or exposed and the _✓a_✓c_✓t_✓i_✓v_✓e window.
  1440.  
  1441.       G✓G✓G✓G_✓_✓_✓_S✓S✓S✓SY✓Y✓Y✓YS✓S✓S✓ST✓T✓T✓TE✓E✓E✓EM✓M✓M✓M
  1442.            A single line containing constant global  information  is  returned.
  1443.            There are currently four fields:
  1444.  
  1445.            1) The _✓h_✓o_✓s_✓t_✓n_✓a_✓m_✓e of the machine MGR is running  on,  as  returned  by
  1446.               _✓g_✓e_✓t_✓h_✓o_✓s_✓t_✓n_✓a_✓m_✓e().
  1447.  
  1448.  
  1449.  
  1450.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  MGR-C Language Application Interface- 20 -                          Macros
  1457.  
  1458.  
  1459.            2) The width of the display in pixels.
  1460.  
  1461.            3) The height of the display in pixels.
  1462.  
  1463.            4) The size of the window borders in pixels.
  1464.  
  1465.       G✓G✓G✓G_✓_✓_✓_T✓T✓T✓TE✓E✓E✓ER✓R✓R✓RM✓M✓M✓MC✓C✓C✓CA✓A✓A✓AP✓P✓P✓P
  1466.            A single line is returned which contains a _✓T_✓E_✓R_✓M_✓C_✓A_✓P  entry  for  MGR.
  1467.            The  _✓T_✓E_✓R_✓M_✓C_✓A_✓P  entry is always the same, except for _✓l_✓i_✓n_✓e_✓s and _✓c_✓o_✓l_✓u_✓m_✓n_✓s
  1468.            entries (li# and co#), which vary  to  reflect  the  current  window
  1469.            size.
  1470.  
  1471.       G✓G✓G✓G_✓_✓_✓_T✓T✓T✓TE✓E✓E✓EX✓X✓X✓XT✓T✓T✓T
  1472.            A single line containing four integers is returned with the  current
  1473.            text  region size.  The first pair of numbers is the top left corner
  1474.            of the text region,  in  _✓w_✓i_✓n_✓d_✓o_✓w  coordinates,  the  second  pair  of
  1475.            numbers  is  the  _✓w_✓i_✓d_✓t_✓h  and  _✓h_✓e_✓i_✓g_✓h_✓t of the text region.  If no text
  1476.            region is defined, implying the entire window is  the  text  region,
  1477.            all four numbers are returned as 0 (zero).
  1478.  
  1479.       G✓G✓G✓G_✓_✓_✓_W✓W✓W✓WI✓I✓I✓IN✓N✓N✓NS✓S✓S✓SI✓I✓I✓IZ✓Z✓Z✓ZE✓E✓E✓E
  1480.            A single line is returned containing the current number  of  _✓c_✓o_✓l_✓u_✓m_✓n_✓s
  1481.            and  _✓r_✓o_✓w_✓s  in  the  _✓t_✓e_✓x_✓t  _✓r_✓e_✓g_✓i_✓o_✓n.  If no text region is defined, the
  1482.            number of _✓l_✓i_✓n_✓e_✓s and _✓c_✓o_✓l_✓u_✓m_✓n_✓s for the entire window is returned.
  1483.  
  1484.       G✓G✓G✓G_✓_✓_✓_F✓F✓F✓FL✓L✓L✓LA✓A✓A✓AG✓G✓G✓GS✓S✓S✓S
  1485.            A single line is returned containing a hexadecimal number represent-
  1486.            ing the current window mode bits.  Each mode is represented by a bit
  1487.            in the word.   Many  of  the  modes  may  be  _✓s_✓e_✓t  or  _✓c_✓l_✓e_✓a_✓r_✓e_✓d  with
  1488.            m_setmode() or m_clearmode().  See the discussion of m_setmode() for
  1489.            a detailed discussion of these flags.  The meaningful mode bits are:
  1490.  
  1491.            0x000001  The window is completely exposed.
  1492.  
  1493.            0x000004  It is possible to use the system _✓c_✓u_✓t function in this win-
  1494.                      dow.   This  mode is restored by clearing the window.  See
  1495.                      m_clear().
  1496.  
  1497.            0x000008  The window is _✓w_✓h_✓i_✓t_✓e text on a _✓b_✓l_✓a_✓c_✓k background.
  1498.  
  1499.            0x000010  The window is in standout mode.  Individual characters are
  1500.                      printed in reverse.
  1501.  
  1502.            0x000020  The window has died.  If a client sees this flag, the win-
  1503.                      dow is about to go away.
  1504.  
  1505.            0x000040  Expose the window upon shell output.  The window  will  be
  1506.                      automatically  activated  when  the next character arrives
  1507.                      for output on the window.
  1508.  
  1509.            0x000080  Permit a partially or totally obscured window to update.
  1510.  
  1511.            0x000100  Do not kill the window when the original  process  started
  1512.                      in  it  dies.   This flag may only be set from the startup
  1513.  
  1514.  
  1515.  
  1516.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  MGR-C Language Application Interface- 21 -                          Macros
  1523.  
  1524.  
  1525.                      file.
  1526.  
  1527.            0x000200  _✓V_✓i mode is turned on.   Pushing  the  right  mouse  button
  1528.                      sends the characters:
  1529.                                           ________________
  1530.                                          |✓|_r✓_✓r✓r✓ro✓_✓o✓o✓ow✓_✓w✓w✓w_H✓__c✓_✓c✓c✓co✓_✓o✓o✓ol✓_✓l✓l✓lu✓_✓u✓u✓um✓_✓m✓m✓mn✓_✓n✓n✓n_|✓__✓|✓|
  1531.                      where r✓r✓r✓ro✓o✓o✓ow✓w✓w✓w and c✓c✓c✓co✓o✓o✓ol✓l✓l✓lu✓u✓u✓um✓m✓m✓mn✓n✓n✓n specifies the character location  the
  1532.                      mouse is sitting on.  This has the effect of aligning _✓v_✓i's
  1533.                      notion of the current character position with the mouse.
  1534.  
  1535.            0x000800  Keyboard input is refused when the window is active.
  1536.  
  1537.            0x001000  Auto  wrap  mode  is  turned  on.   The  character  cursor
  1538.                      automatically  wraps to the beginning of the next row when
  1539.                      it reaches the right margin of the text region.
  1540.  
  1541.            0x002000  Overstrike mode is turned on.  Characters are  written  to
  1542.                      the  window  using the the current drawing mode, as set by
  1543.                      m_func().
  1544.  
  1545.            0x004000  The window is in _✓a_✓b_✓s_✓o_✓l_✓u_✓t_✓e window coordinate mode.
  1546.  
  1547.            0x010000  The system _✓c_✓u_✓t function snarfs complete lines only.
  1548.  
  1549.            0x020000  The system _✓c_✓u_✓t function changes spaces  to  tabs  whenever
  1550.                      possible.  Tabs are assumed to be every 8 spaces.
  1551.  
  1552.            0x040000  The system _✓c_✓u_✓t function will attempt to snarf text even if
  1553.                      errors occur.
  1554.  
  1555.  m_go( x✓x✓x✓x,y✓y✓y✓y)
  1556.       Move the _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s _✓p_✓o_✓i_✓n_✓t to the window position ( x✓x✓x✓x,y✓y✓y✓y) in the current win-
  1557.       dow coordinates.
  1558.  
  1559.  m_gotext()
  1560.       The graphics point is moved to the bottom  left  corner  of  the  current
  1561.       character cursor location.
  1562.  
  1563.  m_halfwin( X✓X✓X✓X,Y✓Y✓Y✓Y,D✓D✓D✓Dw✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h,D✓D✓D✓Dh✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t)
  1564.       A window is created at X✓X✓X✓X,Y✓Y✓Y✓Y of size D✓D✓D✓Dw✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h by D✓D✓D✓Dh✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t with no process con-
  1565.       nected  to it.  MGR returns the name of the file, a _✓p_✓s_✓e_✓u_✓d_✓o-_✓t_✓t_✓y, that must
  1566.       be opened in order to talk to the new window.  A process which opens that
  1567.       _✓p_✓s_✓e_✓u_✓d_✓o-_✓t_✓t_✓y  becomes  a client program, communicating with MGR and the new
  1568.       window in the usual fashion.  For a single process managing multiple win-
  1569.       dows, use m_newwin().
  1570.  
  1571.  m_highlight( X✓X✓X✓X,Y✓Y✓Y✓Y,D✓D✓D✓Dw✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h,D✓D✓D✓Dh✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t)
  1572.       MGR flashes the rectagular portion of the display starting at X✓X✓X✓X,Y✓Y✓Y✓Y of size
  1573.       D✓D✓D✓Dw✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h by D✓D✓D✓Dh✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t.  This is an experimental capability and may be removed
  1574.       in the future.
  1575.  
  1576.  m_incr( n✓n✓n✓n)
  1577.       The current character position is adjusted to the left or right  n✓n✓n✓n  units
  1578.       in _✓w_✓i_✓n_✓d_✓o_✓w coordinates.  The argument n✓n✓n✓n may be signed to indicate movement
  1579.  
  1580.  
  1581.  
  1582.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  MGR-C Language Application Interface- 22 -                          Macros
  1589.  
  1590.  
  1591.       to the left (if negative) or to the  right  (if  positive  or  unsigned).
  1592.       This  is  useful  for  client programs dealing with proportionally spaced
  1593.       text.
  1594.  
  1595.  m_left( n✓n✓n✓n)
  1596.       Move the character cursor left n✓n✓n✓n tenths of a character width.   See  also
  1597.       m_down()m_right()and m_up().
  1598.  
  1599.  m_line( x✓x✓x✓x1✓1✓1✓1,y✓y✓y✓y1✓1✓1✓1,x✓x✓x✓x2✓2✓2✓2,y✓y✓y✓y2✓2✓2✓2)
  1600.       Draw a line in the current window from the coordinate  (  x✓x✓x✓x1✓1✓1✓1,y✓y✓y✓y1✓1✓1✓1)  to  the
  1601.       coordinate  (  x✓x✓x✓x2✓2✓2✓2,y✓y✓y✓y2✓2✓2✓2).   The  line  is either set, cleared or inverted as
  1602.       determined by the last call to m_func().
  1603.  
  1604.  m_linecolor( m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e,c✓c✓c✓co✓o✓o✓ol✓l✓l✓lo✓o✓o✓or✓r✓r✓r)
  1605.       The drawing mode and color is set for all  graphics  and  bit-blt  opera-
  1606.       tions.   The  integer  m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e  sets  the  drawing  mode,  in  the manner of
  1607.       m_func().  The integer c✓c✓c✓co✓o✓o✓ol✓l✓l✓lo✓o✓o✓or✓r✓r✓r is the index into the color lookup table for
  1608.       the drawing color.  This command is equivalent to m_func()on a monochrome
  1609.       display.  See also m_fcolor()and m_linecolor().
  1610.  
  1611.  m_lineto( t✓t✓t✓to✓o✓o✓o,x✓x✓x✓x1✓1✓1✓1,y✓y✓y✓y1✓1✓1✓1,x✓x✓x✓x2✓2✓2✓2,y✓y✓y✓y2✓2✓2✓2)
  1612.       Draw a line on the scratchpad bitmap t✓t✓t✓to✓o✓o✓o from the coordinate (  x✓x✓x✓x1✓1✓1✓1,y✓y✓y✓y1✓1✓1✓1)  to
  1613.       the  coordinate ( x✓x✓x✓x2✓2✓2✓2,y✓y✓y✓y2✓2✓2✓2).  The line is either set, cleared or inverted as
  1614.       determined by the last call to m_func().
  1615.  
  1616.  m_linkmenu( p✓p✓p✓pa✓a✓a✓ar✓r✓r✓re✓e✓e✓en✓n✓n✓nt✓t✓t✓t,i✓i✓i✓it✓t✓t✓te✓e✓e✓em✓m✓m✓m,c✓c✓c✓ch✓h✓h✓hi✓i✓i✓il✓l✓l✓ld✓d✓d✓d,m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e)
  1617.       The menus p✓p✓p✓pa✓a✓a✓ar✓r✓r✓re✓e✓e✓en✓n✓n✓nt✓t✓t✓t and c✓c✓c✓ch✓h✓h✓hi✓i✓i✓il✓l✓l✓ld✓d✓d✓d are linked  together.   When  menu  p✓p✓p✓pa✓a✓a✓ar✓r✓r✓re✓e✓e✓en✓n✓n✓nt✓t✓t✓t  is
  1618.       popped up and item number i✓i✓i✓it✓t✓t✓te✓e✓e✓em✓m✓m✓m (starting from zero) is highlighted, slid-
  1619.       ing off to the right of the p✓p✓p✓pa✓a✓a✓ar✓r✓r✓re✓e✓e✓en✓n✓n✓nt✓t✓t✓t menu causes the c✓c✓c✓ch✓h✓h✓hi✓i✓i✓il✓l✓l✓ld✓d✓d✓d menu to pop  up.
  1620.       When an item is chosen, MGR sends the concatenation of the action strings
  1621.       associated with each of the popped-up menus, from  left  to  right  (i.e.
  1622.       p✓p✓p✓pa✓a✓a✓ar✓r✓r✓re✓e✓e✓en✓n✓n✓nt✓t✓t✓t  to  c✓c✓c✓ch✓h✓h✓hi✓i✓i✓il✓l✓l✓ld✓d✓d✓d).  An arbitrary tree of menus may be created by linking
  1623.       successive menus together in this manner.  It is up to the application to
  1624.       indicate  on the parent menu item that sliding to the right will pop up a
  1625.       child menu.  Typically "-✓-✓-✓->✓>✓>✓>" is used.
  1626.  
  1627.       The m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e argument, if not zero, changes the menu options for  the  p✓p✓p✓pa✓a✓a✓ar✓r✓r✓re✓e✓e✓en✓n✓n✓nt✓t✓t✓t
  1628.       menu.   The  flag  settings,  which  may  be  _✓o_✓r-ed  together (except for
  1629.       M✓M✓M✓MF✓F✓F✓F_✓_✓_✓_C✓C✓C✓CL✓L✓L✓LE✓E✓E✓EA✓A✓A✓AR✓R✓R✓R ) are:
  1630.  
  1631.       M✓M✓M✓MF✓F✓F✓F_✓_✓_✓_S✓S✓S✓SN✓N✓N✓NI✓I✓I✓IP✓P✓P✓P
  1632.            By default, when an item in a _✓c_✓h_✓i_✓l_✓d menu  is  selected,  the  values
  1633.            associated  with the highlighted items for all of the ancestor menus
  1634.            are concatenated  to  the  _✓c_✓h_✓i_✓l_✓d's  item  value.   When  M✓M✓M✓MF✓F✓F✓F_✓_✓_✓_S✓S✓S✓SN✓N✓N✓NI✓I✓I✓IP✓P✓P✓P  is
  1635.            enabled, only the string associated with the child menu is returned.
  1636.  
  1637.       M✓M✓M✓MF✓F✓F✓F_✓_✓_✓_P✓P✓P✓PA✓A✓A✓AG✓G✓G✓GE✓E✓E✓E
  1638.            Normally, whenever a menu is popped-up, the previously  chosen  item
  1639.            is  initially  highlighted.  If M✓M✓M✓MF✓F✓F✓F_✓_✓_✓_P✓P✓P✓PA✓A✓A✓AG✓G✓G✓GE✓E✓E✓E is enabled, this behavior is
  1640.            extended to paged menus.  MGR automatically pages through a  set  of
  1641.            paged menus to highlight the currently selected item.
  1642.  
  1643.       M✓M✓M✓MF✓F✓F✓F_✓_✓_✓_A✓A✓A✓AU✓U✓U✓UT✓T✓T✓TO✓O✓O✓O
  1644.            MGR will automatically slide to the right and pop up a child menu to
  1645.  
  1646.  
  1647.  
  1648.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  MGR-C Language Application Interface- 23 -                          Macros
  1655.  
  1656.  
  1657.            highlight the previously selected item.
  1658.  
  1659.       M✓M✓M✓MF✓F✓F✓F_✓_✓_✓_C✓C✓C✓CL✓L✓L✓LE✓E✓E✓EA✓A✓A✓AR✓R✓R✓R
  1660.            Clears the mode M✓M✓M✓MF✓F✓F✓F_✓_✓_✓_S✓S✓S✓SN✓N✓N✓NI✓I✓I✓IP✓P✓P✓P, M✓M✓M✓MF✓F✓F✓F_✓_✓_✓_P✓P✓P✓PA✓A✓A✓AG✓G✓G✓GE✓E✓E✓E, and M✓M✓M✓MF✓F✓F✓F_✓_✓_✓_A✓A✓A✓AU✓U✓U✓UT✓T✓T✓TO✓O✓O✓O.
  1661.       See also m_loadmenu(), m_selectmenu(), and m_unlinkmenu().
  1662.  
  1663.  m_loadfont( n✓n✓n✓n,n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e)
  1664.       The MGR font whose pathname is n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e is downloaded into MGR, replacing the
  1665.       font   currently   located  at  position  n✓n✓n✓n.   Any  subsequent  calls  to
  1666.       m_font()will select the newly downloaded font.  The font that used to  be
  1667.       at position n✓n✓n✓n remains available to windows that are already using it, but
  1668.       is unavailable for future use.  The format of MGR font files is described
  1669.       in _✓f_✓o_✓n_✓t._✓h.
  1670.  
  1671.  m_loadmenu( n✓n✓n✓n,s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g)
  1672.       The text s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g is downloaded into menu position n✓n✓n✓n.  The first  character
  1673.       of  s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g is the _✓m_✓e_✓n_✓u _✓d_✓e_✓l_✓i_✓m_✓i_✓t_✓e_✓r character.  All of the menu item strings
  1674.       are concatenated, followed by all of their action strings.  The _✓m_✓e_✓n_✓u _✓d_✓e_✓l_✓-
  1675.       _✓i_✓m_✓i_✓t_✓e_✓r  character  separates  all of the items and actions and terminates
  1676.       the list.  Menus are downloaded at once, as a single entity.   The  macro
  1677.       m_selectmenu()  is  used  to  have the menu pop-up when a mouse button is
  1678.       pushed.
  1679.  
  1680.  m_move( c✓c✓c✓co✓o✓o✓ol✓l✓l✓lu✓u✓u✓um✓m✓m✓mn✓n✓n✓n,r✓r✓r✓ro✓o✓o✓ow✓w✓w✓w)
  1681.       The character cursor is moved to character location c✓c✓c✓co✓o✓o✓ol✓l✓l✓lu✓u✓u✓um✓m✓m✓mn✓n✓n✓n,r✓r✓r✓ro✓o✓o✓ow✓w✓w✓w , where  (
  1682.       0✓0✓0✓0,0✓0✓0✓0)  is the top left character position on the window, or on the current
  1683.       text region if one is specified (see m_textregion()).
  1684.  
  1685.  m_movecursor( x✓x✓x✓x,y✓y✓y✓y)
  1686.       Move the character cursor to the position ( x✓x✓x✓x,y✓y✓y✓y) in  window  coordinates.
  1687.       This  permits  characters  to be placed at arbitrary pixel locations, not
  1688.       just on character boundaries.  Use m_move()to move to a  r✓r✓r✓ro✓o✓o✓ow✓w✓w✓w  and  c✓c✓c✓co✓o✓o✓ol✓l✓l✓lu✓u✓u✓um✓m✓m✓mn✓n✓n✓n
  1689.       position.
  1690.  
  1691.  m_movemouse( X✓X✓X✓X,Y✓Y✓Y✓Y)
  1692.       Move the mouse to position ( X✓X✓X✓X,Y✓Y✓Y✓Y) in _✓d_✓i_✓s_✓p_✓l_✓a_✓y coordinates.  Excessive  use
  1693.       of this macro is anti-social.
  1694.  
  1695.  m_moveprint( x✓x✓x✓x,y✓y✓y✓y,s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g)
  1696.       Print s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g at the window coordinate ( x✓x✓x✓x,y✓y✓y✓y).  This macro  is  equivalent
  1697.       to calling m_movecursor() followed by m_printstr().
  1698.  
  1699.  m_movewindow( X✓X✓X✓X,Y✓Y✓Y✓Y)
  1700.       Move the window to the display location ( X✓X✓X✓X,Y✓Y✓Y✓Y)  in  _✓d_✓i_✓s_✓p_✓l_✓a_✓y  coordinates.
  1701.       If  the new position is too close to the edge of the display for the win-
  1702.       dow to fit entirely at the requested location, the right edge  or  bottom
  1703.       of the window is truncated at the boundary of the display.
  1704.       An alternate window is created with the size and location indicated.  The
  1705.       arguments  X✓X✓X✓X and Y✓Y✓Y✓Y specify the upper left corner of the window, D✓D✓D✓Dw✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e and
  1706.       D✓D✓D✓Dh✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h the size.  If the window is to be to fit at the requested location,
  1707.       its  size is truncated appropriately.  MGR will return a window number if
  1708.       the creation is successful, or a _✓n_✓e_✓w_✓l_✓i_✓n_✓e  if  the  window  could  not  be
  1709.       created.   The newly created window is made the _✓a_✓c_✓t_✓i_✓v_✓e window.  The macro
  1710.       m_selectwin()is used to enable writing on the newly created window.
  1711.  
  1712.  
  1713.  
  1714.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  MGR-C Language Application Interface- 24 -                          Macros
  1721.  
  1722.  
  1723.  m_nomenu()
  1724.       Deselect all menus.  No menu will pop-up when the middle mouse button  is
  1725.       pressed.   This call does not delete the menu, it simply disassociates it
  1726.       from the button.
  1727.  
  1728.  m_nomenu2()
  1729.       Deselect all menus.  No menu will pop-up when the right mouse  button  is
  1730.       pressed.   This call does not delete the menu, it simply disassociates it
  1731.       from the button.  This macro should be combined with  m_nomenu()  but  is
  1732.       separate for historical reasons.
  1733.  
  1734.  m_othersave( i✓i✓i✓id✓d✓d✓d,s✓s✓s✓su✓u✓u✓ub✓b✓b✓b,n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e)
  1735.       The bitmap contents of the window identified as i✓i✓i✓id✓d✓d✓d.s✓s✓s✓su✓u✓u✓ub✓b✓b✓b is  saved  in  the
  1736.       file  n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e  in  bitmap format (see _✓d_✓u_✓m_✓p._✓h for a description of the bitmap
  1737.       format).  The _✓w_✓i_✓n_✓d_✓o_✓w _✓i_✓d can be determined either  by  calling  m_getinfo(
  1738.       G✓G✓G✓G_✓_✓_✓_A✓A✓A✓AL✓L✓L✓LL✓L✓L✓L)   or  from  the  event  _✓M__✓A_✓C_✓C_✓E_✓P_✓T  (see  m_setevent()).   See  also
  1739.       m_windowsave() and m_bitsave().
  1740.  
  1741.  m_pagemenu( p✓p✓p✓pa✓a✓a✓ar✓r✓r✓re✓e✓e✓en✓n✓n✓nt✓t✓t✓t,c✓c✓c✓ch✓h✓h✓hi✓i✓i✓il✓l✓l✓ld✓d✓d✓d)
  1742.       Connect menu c✓c✓c✓ch✓h✓h✓hi✓i✓i✓il✓l✓l✓ld✓d✓d✓d to the bottom of menu p✓p✓p✓pa✓a✓a✓ar✓r✓r✓re✓e✓e✓en✓n✓n✓nt✓t✓t✓t to permit a long menu  to
  1743.       be  paged.  Mousing off the bottom of the p✓p✓p✓pa✓a✓a✓ar✓r✓r✓re✓e✓e✓en✓n✓n✓nt✓t✓t✓t menu automatically pops-
  1744.       up the _✓c_✓h_✓i_✓l_✓d menu, which in turn may be the parent of another menu.   See
  1745.       also m_unpagemenu(), m_linkmenu() and m_unlinkmenu().
  1746.  
  1747.  m_pop()
  1748.       Pop the window  context.   The  last  window  context  saved  by  calling
  1749.       m_push()  or  m_pushsave()  is  restored.   If  no environments have been
  1750.       pushed, m_pop()is ignored.
  1751.  
  1752.  m_popall()
  1753.       Like m_pop()above, except all environments pushed since the first call to
  1754.       m_setup()are  popped.   The macro m_popall() is typically used as part of
  1755.       the clean up before client program termination.
  1756.  
  1757.  m_printstr( s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g)
  1758.       Print s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g on the window at  the  current  character  cursor  location.
  1759.       This  is  equivalent to the _✓s_✓t_✓d_✓i_✓o function _✓p_✓r_✓i_✓n_✓t_✓f with a %_✓s format speci-
  1760.       fied and the output directed toward the file pointer _✓m__✓t_✓e_✓r_✓m_✓o_✓u_✓t instead of
  1761.       _✓s_✓t_✓d_✓o_✓u_✓t.
  1762.  
  1763.  m_push( m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e)
  1764.       Certain parts (stack modes) of the  current  window  environment  may  be
  1765.       moved  to  a  stack,  to  be  restored  at  a  later  time with m_pop()or
  1766.       m_popall().  Any combination  of  the  following  pieces  of  the  window
  1767.       environment, called a window context, may be placed on the window stack.
  1768.  
  1769.       P✓P✓P✓P_✓_✓_✓_B✓B✓B✓BI✓I✓I✓IT✓T✓T✓TM✓M✓M✓MA✓A✓A✓AP✓P✓P✓P
  1770.            All currently defined _✓s_✓c_✓r_✓a_✓t_✓c_✓h_✓p_✓a_✓d bitmaps are moved to the stack  and
  1771.            become undefined in the current window context.
  1772.  
  1773.       P✓P✓P✓P_✓_✓_✓_C✓C✓C✓CU✓U✓U✓UR✓R✓R✓RS✓S✓S✓SO✓O✓O✓OR✓R✓R✓R
  1774.            The current _✓c_✓h_✓a_✓r_✓a_✓c_✓t_✓e_✓r cursor and _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s _✓p_✓o_✓i_✓n_✓t positions are  saved
  1775.            on the stack.
  1776.  
  1777.  
  1778.  
  1779.  
  1780.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  MGR-C Language Application Interface- 25 -                          Macros
  1787.  
  1788.  
  1789.       P✓P✓P✓P_✓_✓_✓_E✓E✓E✓EV✓V✓V✓VE✓E✓E✓EN✓N✓N✓NT✓T✓T✓T
  1790.            All currently defined events are moved to the stack and become unde-
  1791.            fined in the current window context.
  1792.  
  1793.       P✓P✓P✓P_✓_✓_✓_F✓F✓F✓FL✓L✓L✓LA✓A✓A✓AG✓G✓G✓GS✓S✓S✓S
  1794.            The window modes, as set with m_setmode()are  moved  to  the  stack.
  1795.            The  modes  revert  to  their default settings in the current window
  1796.            context.
  1797.  
  1798.       P✓P✓P✓P_✓_✓_✓_F✓F✓F✓FO✓O✓O✓ON✓N✓N✓NT✓T✓T✓T
  1799.            The current font setting is copied to the stack.  If  this  font  is
  1800.            subsequently  deleted, by writing over it with a different font, the
  1801.            original font setting is retained, even  if  it  can  no  longer  be
  1802.            accessed using m_font().
  1803.  
  1804.       P✓P✓P✓P_✓_✓_✓_M✓M✓M✓ME✓E✓E✓EN✓N✓N✓NU✓U✓U✓U
  1805.            All downloaded menus and menu links are moved to the the stack along
  1806.            with the currently selected menu number.  The menus become undefined
  1807.            in the current context.
  1808.  
  1809.       P✓P✓P✓P_✓_✓_✓_M✓M✓M✓MO✓O✓O✓OU✓U✓U✓US✓S✓S✓SE✓E✓E✓E
  1810.            The mouse cursor location is saved on the stack.  Its current  loca-
  1811.            tion remains the same.
  1812.  
  1813.       P✓P✓P✓P_✓_✓_✓_P✓P✓P✓PO✓O✓O✓OS✓S✓S✓SI✓I✓I✓IT✓T✓T✓TI✓I✓I✓IO✓O✓O✓ON✓N✓N✓N
  1814.            The window size and location is saved on  the  stack.   The  current
  1815.            size and location are maintained.
  1816.  
  1817.       P✓P✓P✓P_✓_✓_✓_T✓T✓T✓TE✓E✓E✓EX✓X✓X✓XT✓T✓T✓T
  1818.            The text region location and size are saved on the stack.  The  text
  1819.            region in the current context is reset to the entire window.
  1820.  
  1821.       P✓P✓P✓P_✓_✓_✓_W✓W✓W✓WI✓I✓I✓IN✓N✓N✓ND✓D✓D✓DO✓O✓O✓OW✓W✓W✓W
  1822.            The current image contents of the window is  copied  to  the  stack.
  1823.            This is done without altering the current contents of the window.
  1824.       Stack modes are combined by _✓o_✓r-ing them together to form a  saved  window
  1825.       context,  such  as:          m_push(  P✓P✓P✓P_✓_✓_✓_M✓M✓M✓ME✓E✓E✓EN✓N✓N✓NU✓U✓U✓U|✓|✓|✓|P✓P✓P✓P_✓_✓_✓_E✓E✓E✓EV✓V✓V✓VE✓E✓E✓EN✓N✓N✓NT✓T✓T✓T) which will save all
  1826.       events, and menus but leave everything else alone.  All stack modes  that
  1827.       require  client  download data revert to their default settings when they
  1828.       are  _✓p_✓u_✓s_✓h_✓e_✓d.   For  example,  after  m_push(  P✓P✓P✓P_✓_✓_✓_M✓M✓M✓ME✓E✓E✓EN✓N✓N✓NU✓U✓U✓U|✓|✓|✓|P✓P✓P✓P_✓_✓_✓_E✓E✓E✓EV✓V✓V✓VE✓E✓E✓EN✓N✓N✓NT✓T✓T✓T|✓|✓|✓|P✓P✓P✓P_✓_✓_✓_M✓M✓M✓MO✓O✓O✓OU✓U✓U✓US✓S✓S✓SE✓E✓E✓E)  is
  1829.       called,  no  events or menus are currently defined, but the mouse remains
  1830.       where it is.  The defined constant _✓P__✓A_✓L_✓L refers to all of the modes.
  1831.  
  1832.  m_pushsave( m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e)
  1833.       Certain parts (stack modes) of the  current  window  environment  may  be
  1834.       copied  to  a  stack,  to  be  restored  at  a  later time with m_pop()or
  1835.       m_popall().  The macro m_pushsave() differs from  m_push()in  that  down-
  1836.       loaded data, such as _✓m_✓e_✓n_✓u_✓s _✓e_✓v_✓e_✓n_✓t_✓s or _✓s_✓c_✓r_✓a_✓t_✓c_✓h_✓p_✓a_✓d bitmaps are copied to the
  1837.       stack instead of moved, and thus remain  in  effect  after  the  call  to
  1838.       m_pushsave().  The current window context is thus unaffected.  Any combi-
  1839.       nation of the following pieces of the window environment may be copied to
  1840.       the window stack.
  1841.  
  1842.       P✓P✓P✓P_✓_✓_✓_B✓B✓B✓BI✓I✓I✓IT✓T✓T✓TM✓M✓M✓MA✓A✓A✓AP✓P✓P✓P
  1843.  
  1844.  
  1845.  
  1846.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  MGR-C Language Application Interface- 26 -                          Macros
  1853.  
  1854.  
  1855.            All currently defined _✓s_✓c_✓r_✓a_✓t_✓c_✓h_✓p_✓a_✓d bitmaps are copied to the stack.
  1856.  
  1857.       P✓P✓P✓P_✓_✓_✓_C✓C✓C✓CU✓U✓U✓UR✓R✓R✓RS✓S✓S✓SO✓O✓O✓OR✓R✓R✓R
  1858.            The current _✓c_✓h_✓a_✓r_✓a_✓c_✓t_✓e_✓r and _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s cursor positions are saved on the
  1859.            stack.
  1860.  
  1861.       P✓P✓P✓P_✓_✓_✓_E✓E✓E✓EV✓V✓V✓VE✓E✓E✓EN✓N✓N✓NT✓T✓T✓T
  1862.            All currently defined events are copied to the stack.
  1863.  
  1864.       P✓P✓P✓P_✓_✓_✓_F✓F✓F✓FL✓L✓L✓LA✓A✓A✓AG✓G✓G✓GS✓S✓S✓S
  1865.            The window modes, as set with m_setmode(), are copied to the stack.
  1866.  
  1867.       P✓P✓P✓P_✓_✓_✓_F✓F✓F✓FO✓O✓O✓ON✓N✓N✓NT✓T✓T✓T
  1868.            The current font setting is copied to the stack.  If  this  font  is
  1869.            subsequently  deleted, by writing over it with a different font, the
  1870.            original font setting is retained, even  if  it  can  no  longer  be
  1871.            accessed using m_font().
  1872.  
  1873.       P✓P✓P✓P_✓_✓_✓_M✓M✓M✓ME✓E✓E✓EN✓N✓N✓NU✓U✓U✓U
  1874.            All downloaded menus and menu links are  copied  to  the  the  stack
  1875.            along with the currently selected menu number.
  1876.  
  1877.       P✓P✓P✓P_✓_✓_✓_M✓M✓M✓MO✓O✓O✓OU✓U✓U✓US✓S✓S✓SE✓E✓E✓E
  1878.            The mouse cursor location is saved on the stack.
  1879.  
  1880.       P✓P✓P✓P_✓_✓_✓_P✓P✓P✓PO✓O✓O✓OS✓S✓S✓SI✓I✓I✓IT✓T✓T✓TI✓I✓I✓IO✓O✓O✓ON✓N✓N✓N
  1881.            The window size and location are saved on the stack.
  1882.  
  1883.       P✓P✓P✓P_✓_✓_✓_T✓T✓T✓TE✓E✓E✓EX✓X✓X✓XT✓T✓T✓T
  1884.            The text region location and size are saved on the stack.
  1885.  
  1886.       P✓P✓P✓P_✓_✓_✓_W✓W✓W✓WI✓I✓I✓IN✓N✓N✓ND✓D✓D✓DO✓O✓O✓OW✓W✓W✓W
  1887.            The current image contents of the window is copied to the stack.
  1888.       Stack modes are combined by _✓o_✓r-ing them together to form a  saved  window
  1889.       context,  such  as:          m_push(  P✓P✓P✓P_✓_✓_✓_M✓M✓M✓ME✓E✓E✓EN✓N✓N✓NU✓U✓U✓U|✓|✓|✓|P✓P✓P✓P_✓_✓_✓_E✓E✓E✓EV✓V✓V✓VE✓E✓E✓EN✓N✓N✓NT✓T✓T✓T) which will save all
  1890.       events, and menus but leave everything else alone.
  1891.  
  1892.  m_put( s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g)
  1893.       S✓S✓S✓St✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g is put into the global _✓s_✓n_✓a_✓r_✓f buffer.  There is one  common  buffer
  1894.       for  all  clients  programs.  The macro m_snarf() is used to retrieve the
  1895.       contents of the buffer.  The MGR system _✓c_✓u_✓t function places text in  this
  1896.       buffer, whereas the system _✓p_✓a_✓s_✓t_✓e function pastes text from this buffer.
  1897.  
  1898.  m_putchar( c✓c✓c✓c)
  1899.       The character c✓c✓c✓c is written in the window at the current character  cursor
  1900.       location.   This  function  is  like  the _✓s_✓t_✓d_✓i_✓o _✓p_✓u_✓t_✓c_✓h_✓a_✓r(_✓c), only directed
  1901.       toward the client's window.
  1902.  
  1903.  m_rcircle( r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s)
  1904.       A circle of radius r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s is drawn,  centered  at  the  current  _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s
  1905.       _✓p_✓o_✓i_✓n_✓t.  The points at the edge of the circle are set, cleared or inverted
  1906.       depending upon the last call to m_func().  Circles are  always  drawn  as
  1907.       circles, both in _✓a_✓b_✓s_✓o_✓l_✓u_✓t_✓e and in _✓r_✓e_✓l_✓a_✓t_✓i_✓v_✓e window coordinates.  The r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s
  1908.       is scaled based upon the average w✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h and h✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t of the window.
  1909.  
  1910.  
  1911.  
  1912.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  MGR-C Language Application Interface- 27 -                          Macros
  1919.  
  1920.  
  1921.  m_rellipse( r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s1✓1✓1✓1,r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s2✓2✓2✓2)
  1922.       Draw an ellipse centered at the _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s _✓p_✓o_✓i_✓n_✓t.  The two  radii,  r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s1✓1✓1✓1
  1923.       and r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s2✓2✓2✓2 specify the major and minor axis.  The ellipse is either set,
  1924.       cleared, or inverted determined by the last call  to  m_func().   If  the
  1925.       window  is  in  _✓r_✓e_✓l_✓a_✓t_✓i_✓v_✓e  coordinate mode, r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s1✓1✓1✓1 and r✓r✓r✓ra✓a✓a✓ad✓d✓d✓di✓i✓i✓iu✓u✓u✓us✓s✓s✓s2✓2✓2✓2 are scaled
  1926.       based upon the average w✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h and h✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t of the window.
  1927.  
  1928.  m_resetesc()
  1929.       The MGR _✓e_✓s_✓c_✓a_✓p_✓e character is reset to its to default value ('\033').  This
  1930.       turns off the debugging mode turned on by m_setesc().
  1931.  
  1932.  m_rfastdraw( c✓c✓c✓co✓o✓o✓ou✓u✓u✓un✓n✓n✓nt✓t✓t✓t,d✓d✓d✓da✓a✓a✓at✓t✓t✓ta✓a✓a✓a)
  1933.       The next c✓c✓c✓co✓o✓o✓ou✓u✓u✓un✓n✓n✓nt✓t✓t✓t bytes of d✓d✓d✓da✓a✓a✓at✓t✓t✓ta✓a✓a✓a are sent to MGR are  to  be  interpreted  as
  1934.       lines  drawn  in  _✓f_✓a_✓s_✓t _✓d_✓r_✓a_✓w mode, starting at The current graphics point.
  1935.       _✓F_✓a_✓s_✓t _✓d_✓r_✓a_✓w mode permits the rapid drawing of short vectors by encoding  an
  1936.       _✓x,_✓y  displacement  location  in  a single byte.  The _✓x coordinate is con-
  1937.       tained in the most significant 4 bits, the _✓y coordinate in the least sig-
  1938.       nificant  4  bits.   Values  for _✓x and _✓y represent displacements from the
  1939.       previous location, and range from +7 to -8.  A 7 is coded as _✓0_✓x_✓f_✓f,  a  -8
  1940.       as  _✓0_✓x_✓0_✓0.   If both _✓x and _✓y are zero (i.e.  _✓0_✓x_✓8_✓0_✓8_✓0).  The next coordinate
  1941.       is taken to be a _✓m_✓o_✓v_✓e instead of a _✓d_✓r_✓a_✓w.  An eight  bit  channel  between
  1942.       MGR  and  the  client  program  is required for _✓f_✓a_✓s_✓t _✓d_✓r_✓a_✓w mode.  See also
  1943.       m_fastdraw().
  1944.  
  1945.  m_right( n✓n✓n✓n)
  1946.       Move the character cursor right n✓n✓n✓n tenths of a character width.  See  also
  1947.       m_left()m_down()and m_up().
  1948.  
  1949.  m_scrollregion( f✓f✓f✓fi✓i✓i✓ir✓r✓r✓rs✓s✓s✓st✓t✓t✓t_✓_✓_✓_r✓r✓r✓ro✓o✓o✓ow✓w✓w✓w,l✓l✓l✓la✓a✓a✓as✓s✓s✓st✓t✓t✓t_✓_✓_✓_r✓r✓r✓ro✓o✓o✓ow✓w✓w✓w)
  1950.       This sets up a _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n as a _✓V_✓T_✓1_✓0_✓0-_✓l_✓i_✓k_✓e scrolling region.  The  entire
  1951.       width  of  the  window from lines f✓f✓f✓fi✓i✓i✓ir✓r✓r✓rs✓s✓s✓st✓t✓t✓t_✓_✓_✓_r✓r✓r✓ro✓o✓o✓ow✓w✓w✓w to l✓l✓l✓la✓a✓a✓as✓s✓s✓st✓t✓t✓t_✓_✓_✓_r✓r✓r✓ro✓o✓o✓ow✓w✓w✓w inclusive becomes
  1952.       the _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n.  See also m_textregion().
  1953.  
  1954.  m_selectmenu( n✓n✓n✓n)
  1955.       This macro is used to indicate menu n✓n✓n✓n pops-up in response to pressing the
  1956.       _✓m_✓i_✓d_✓d_✓l_✓e  mouse  button.   Menus  are downloaded (with m_loadmenu()) first,
  1957.       then selected.  Only one menu may be selected at a time on  each  button.
  1958.       If  the  button  is already down when this call is made, and there is not
  1959.       currently a menu associated with the button, then the menu just  selected
  1960.       pops-up  immediately.   This last feature may be used to pop up different
  1961.       menus in a context sensitive way.
  1962.  
  1963.  m_selectmenu2( n✓n✓n✓n)
  1964.       This macro is used to indicate menu n✓n✓n✓n pops-up in response to pressing the
  1965.       _✓r_✓i_✓g_✓h_✓t mouse button.  Menus are downloaded (with m_loadmenu()) first, then
  1966.       selected.  This macro functions the same as, and should be combined  with
  1967.       m_selectmenu() above, but exists separately for historical reasons.
  1968.  
  1969.  m_selectwin( n✓n✓n✓n)
  1970.       Select alternate window  n✓n✓n✓n  for  output.   Alternate  windows  are  first
  1971.       created  by  m_newwin().   All  output  goes to the selected window until
  1972.       either m_selectwin()is called to change windows, or the  selected  window
  1973.       is  destroyed.  If n✓n✓n✓n is 0 (zero) or the currently selected window is des-
  1974.       troyed, the main, or original window is selected.  Input from all windows
  1975.  
  1976.  
  1977.  
  1978.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  MGR-C Language Application Interface- 28 -                          Macros
  1985.  
  1986.  
  1987.       is  send  to  the  client  program  on the same input channel.  The macro
  1988.       m_setevent( A✓A✓A✓AC✓C✓C✓CT✓T✓T✓TI✓I✓I✓IV✓V✓V✓VA✓A✓A✓AT✓T✓T✓TE✓E✓E✓E) may be used to help decide  what  window  generated
  1989.       the  input  by  associating  a  unique string with each window's _✓A_✓C_✓T_✓I_✓V_✓A_✓T_✓E
  1990.       event.  The _✓s_✓e_✓l_✓e_✓c_✓t_✓e_✓d window and the _✓a_✓c_✓t_✓i_✓v_✓e window are specified  indepen-
  1991.       dently.   Selecting  a  window  does  not  make it the _✓a_✓c_✓t_✓i_✓v_✓e window, and
  1992.       creating a new window, although it is created as the  _✓a_✓c_✓t_✓i_✓v_✓e  window,  is
  1993.       not automatically selected.
  1994.  
  1995.  m_sendme( s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g)
  1996.       The argument s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g is sent back to the client process as if it was typed
  1997.       in at the keyboard.
  1998.  
  1999.  m_sendto( n✓n✓n✓n,s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g)
  2000.       The message s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g is send to window n✓n✓n✓n.  A unique window identifier, n✓n✓n✓n is
  2001.       determined  with  either  m_setevent()  using  the  %_✓w  option,  or  with
  2002.       m_getinfo().  In general, the window id n✓n✓n✓n is the process id (_✓p_✓i_✓d) of  the
  2003.       client program started by MGR when the window was created.  If the target
  2004.       window has turned on _✓A_✓C_✓C_✓E_✓P_✓T with m_setevent(), s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g is received by  the
  2005.       client  program  associated  with the target window as part of the _✓A_✓C_✓C_✓E_✓P_✓T
  2006.       event.  General write permissions must be disabled on the target client's
  2007.       _✓p_✓s_✓e_✓u_✓d_✓otty  in order for the message to be received, to prevent unsuspect-
  2008.       ing _✓s_✓h_✓e_✓l_✓ls from interpreting messages sent by unscrupulous  processes  as
  2009.       commands.  See also m_broadcast().
  2010.  
  2011.  m_setesc( c✓c✓c✓c)
  2012.       This macro call causes the character c✓c✓c✓c to be used as the MGR escape char-
  2013.       acter  by  the library package (instead of '\_✓0_✓3_✓3').  This permits viewing
  2014.       the output stream to MGR without causing the commands to be executed.
  2015.  
  2016.  m_setecho()
  2017.       Turn on character echoing, if possible.  Character  echoing  is  normally
  2018.       disabled  by  clients  to  inhibit information from MGR, as from calls to
  2019.       m_getinfo(), from echoing on the window.
  2020.  
  2021.  m_setevent( n✓n✓n✓n,s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g)
  2022.       An event string, s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g is sent to the client program  by  MGR  upon  the
  2023.       occurrence  of the specified event n✓n✓n✓n.  The event string is typically read
  2024.       by the client program using m_gets().  Event strings are  never  sent  in
  2025.       response to an event unless specifically requested by the client program.
  2026.       Events are one of the following types.
  2027.  
  2028.       A✓A✓A✓AC✓C✓C✓CT✓T✓T✓TI✓I✓I✓IV✓V✓V✓VA✓A✓A✓AT✓T✓T✓TE✓E✓E✓E
  2029.            The window became the _✓a_✓c_✓t_✓i_✓v_✓e window.  It is  at  the  front  of  the
  2030.            display, and is currently receiving both mouse and keyboard input.
  2031.  
  2032.       B✓B✓B✓BU✓U✓U✓UT✓T✓T✓TT✓T✓T✓TO✓O✓O✓ON✓N✓N✓N_✓_✓_✓_1✓1✓1✓1
  2033.            The right mouse button was depressed.  This event is  sent  only  to
  2034.            the _✓a_✓c_✓t_✓i_✓v_✓e window.
  2035.  
  2036.       B✓B✓B✓BU✓U✓U✓UT✓T✓T✓TT✓T✓T✓TO✓O✓O✓ON✓N✓N✓N_✓_✓_✓_1✓1✓1✓1U✓U✓U✓U
  2037.            The right mouse button was released.  This event is sent only to the
  2038.            _✓a_✓c_✓t_✓i_✓v_✓e window.
  2039.  
  2040.       B✓B✓B✓BU✓U✓U✓UT✓T✓T✓TT✓T✓T✓TO✓O✓O✓ON✓N✓N✓N_✓_✓_✓_2✓2✓2✓2
  2041.  
  2042.  
  2043.  
  2044.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  MGR-C Language Application Interface- 29 -                          Macros
  2051.  
  2052.  
  2053.            The middle mouse button was depressed.  This event is sent  only  to
  2054.            the _✓a_✓c_✓t_✓i_✓v_✓e window.
  2055.  
  2056.       B✓B✓B✓BU✓U✓U✓UT✓T✓T✓TT✓T✓T✓TO✓O✓O✓ON✓N✓N✓N_✓_✓_✓_2✓2✓2✓2U✓U✓U✓U
  2057.            The middle mouse button was released.  This event is  sent  only  to
  2058.            the _✓a_✓c_✓t_✓i_✓v_✓e window.
  2059.  
  2060.       C✓C✓C✓CO✓O✓O✓OV✓V✓V✓VE✓E✓E✓ER✓R✓R✓RE✓E✓E✓ED✓D✓D✓D
  2061.            The window was partially or completely obscured by another window.
  2062.  
  2063.       D✓D✓D✓DE✓E✓E✓EA✓A✓A✓AC✓C✓C✓CT✓T✓T✓TI✓I✓I✓IV✓V✓V✓VA✓A✓A✓AT✓T✓T✓TE✓E✓E✓E
  2064.            The window was deactivated, it is no longer the _✓a_✓c_✓t_✓i_✓v_✓e window.
  2065.  
  2066.       R✓R✓R✓RE✓E✓E✓ED✓D✓D✓DR✓R✓R✓RA✓A✓A✓AW✓W✓W✓W
  2067.            The display was redrawn, either by selecting the _✓r_✓e_✓d_✓r_✓a_✓w option  from
  2068.            the  system  menu, or by keying _✓L_✓E_✓F_✓T-_✓r from the keyboard.  Only win-
  2069.            dows that are exposed receive  the  _✓R_✓E_✓D_✓R_✓A_✓W  event.   The  images  of
  2070.            obscured windows are restored automatically by MGR.  The client pro-
  2071.            gram is expected  to  regenerate  the  contents  of  its  window  in
  2072.            response to the _✓R_✓E_✓D_✓R_✓A_✓W event.
  2073.  
  2074.       R✓R✓R✓RE✓E✓E✓ES✓S✓S✓SH✓H✓H✓HA✓A✓A✓AP✓P✓P✓PE✓E✓E✓E
  2075.            The window was reshaped.  If the user  selects  the  system  _✓r_✓e_✓s_✓h_✓a_✓p_✓e
  2076.            option, the _✓R_✓E_✓S_✓H_✓A_✓P_✓E event is sent, even if the window stays the same
  2077.            shape.
  2078.  
  2079.       U✓U✓U✓UN✓N✓N✓NC✓C✓C✓CO✓O✓O✓OV✓V✓V✓VE✓E✓E✓ER✓R✓R✓RE✓E✓E✓ED✓D✓D✓D
  2080.            The window, previously obscured, was uncovered.  If the window  also
  2081.            became  the  _✓a_✓c_✓t_✓i_✓v_✓e  window,  the _✓U_✓N_✓C_✓O_✓V_✓E_✓R_✓E_✓D event is sent before the
  2082.            _✓A_✓C_✓T_✓I_✓V_✓A_✓T_✓E event.
  2083.  
  2084.       M✓M✓M✓MO✓O✓O✓OV✓V✓V✓VE✓E✓E✓E
  2085.            The window was moved.
  2086.  
  2087.       D✓D✓D✓DE✓E✓E✓ES✓S✓S✓ST✓T✓T✓TR✓R✓R✓RO✓O✓O✓OY✓Y✓Y✓Y
  2088.            The window was destroyed.  Only _✓a_✓l_✓t_✓e_✓r_✓n_✓a_✓t_✓e  windows  (as  created  by
  2089.            m_newwin())  cause _✓D_✓E_✓S_✓T_✓R_✓O_✓Y events to be sent.  If the _✓m_✓a_✓i_✓n window is
  2090.            destroyed, the client program is sent a _✓h_✓a_✓n_✓g_✓u_✓p signal, and its  con-
  2091.            nection to MGR is severed.
  2092.  
  2093.       A✓A✓A✓AC✓C✓C✓CC✓C✓C✓CE✓E✓E✓EP✓P✓P✓PT✓T✓T✓T
  2094.            Messages are accepted from client programs running in other  windows
  2095.            (see  m_sendto()).  The content of the message is obtained by speci-
  2096.            fying the %✓%✓%✓%m✓m✓m✓m parameter as part of the  event  string,  as  is  fully
  2097.            described below.
  2098.  
  2099.       N✓N✓N✓NO✓O✓O✓OT✓T✓T✓TI✓I✓I✓IF✓F✓F✓FY✓Y✓Y✓Y
  2100.            Register a name with MGR, and make this  name  available  to  client
  2101.            programs.  This name is available to other clients, either by a call
  2102.            to m_getinfo( G✓G✓G✓G_✓_✓_✓_N✓N✓N✓NO✓O✓O✓OT✓T✓T✓TI✓I✓I✓IF✓F✓F✓FY✓Y✓Y✓Y) or with the %✓%✓%✓%n✓n✓n✓n  parameter  described  below.
  2103.            Unlike the other events, the _✓n_✓o_✓t_✓i_✓f_✓y string is never sent back to the
  2104.            client program by MGR, but is used to register a name for  the  win-
  2105.            dow.
  2106.  
  2107.  
  2108.  
  2109.  
  2110.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.  MGR-C Language Application Interface- 30 -                          Macros
  2117.  
  2118.  
  2119.       S✓S✓S✓SN✓N✓N✓NA✓A✓A✓AR✓R✓R✓RF✓F✓F✓FE✓E✓E✓ED✓D✓D✓D
  2120.            Text was put into the snarf buffer either by a client  program  with
  2121.            m_put() or by use of the system _✓c_✓u_✓t function.
  2122.  
  2123.       P✓P✓P✓PA✓A✓A✓AS✓S✓S✓ST✓T✓T✓TE✓E✓E✓E
  2124.            Text is about to arrive as a result of the system _✓p_✓a_✓s_✓t_✓efunction.
  2125.  
  2126.       Some _✓e_✓v_✓e_✓n_✓t strings may contain substitutable parameters in the manner  of
  2127.       _✓p_✓r_✓i_✓n_✓t_✓f format specifiers (i.e. %X).  These parameters are applicable only
  2128.       to certain types of events.  In any case, the % character may  be  forced
  2129.       by  doubling  it,  as  in %%.  Where more than one data item replaces the
  2130.       format specifier, the items are separated by a _✓s_✓p_✓a_✓c_✓e character.  For  the
  2131.       event  strings  B✓B✓B✓BU✓U✓U✓UT✓T✓T✓TT✓T✓T✓TO✓O✓O✓ON✓N✓N✓N_✓_✓_✓_1✓1✓1✓1  and  B✓B✓B✓BU✓U✓U✓UT✓T✓T✓TT✓T✓T✓TO✓O✓O✓ON✓N✓N✓N_✓_✓_✓_2✓2✓2✓2,  several parameters cause MGR to
  2132.       sweep out some object in response to mouse movement, and report back  the
  2133.       size  of the swept object when the button is released.  Any one of lines,
  2134.       boxes, text, or rectangles may be swept out with this mechanism.  Initial
  2135.       parameters  may be associated with a sweep event by listing them as comma
  2136.       separated integers following the % and preceding the sweep command  char-
  2137.       acter.   The parameters (if any) set the initial size of the object to be
  2138.       swept, in the same  coordinate  system  in  which  the  sweep  extend  is
  2139.       reported.
  2140.  
  2141.       %✓%✓%✓%r✓r✓r✓r   Depressing the button  causes  MGR  to  sweep  out  a  rectangle  in
  2142.            response  to  moving  the  mouse,  in a manner similar to the system
  2143.            _✓r_✓e_✓s_✓h_✓a_✓p_✓e function.  The initial parameters set the initial width  and
  2144.            height  of  the rectangle.  When the button is released, the coordi-
  2145.            nates of the _✓s_✓t_✓a_✓r_✓t_✓i_✓n_✓g and _✓e_✓n_✓d_✓i_✓n_✓g points of the rectangle in response
  2146.            to  moving the mouse, in _✓w_✓i_✓n_✓d_✓o_✓w coordinates, are substituted for the
  2147.            %_✓r.
  2148.  
  2149.       %✓%✓%✓%R✓R✓R✓R   Depressing the button causes MGR to sweep out a rectangle, as in  %_✓r
  2150.            above, only the the result is in _✓d_✓i_✓s_✓p_✓l_✓a_✓ycoordinates.
  2151.  
  2152.       %✓%✓%✓%b✓b✓b✓b   Depressing the button causes MGR to move a rectangle in response  to
  2153.            moving  the  mouse, in a manner similar to the system _✓m_✓o_✓v_✓e function.
  2154.            The initial parameters set the initial width and height of the  rec-
  2155.            tangle  to be moved.  When the button is released, the current coor-
  2156.            dinates of the box's corner is returned in _✓w_✓i_✓n_✓d_✓o_✓w coordinates,  sub-
  2157.            stituted for the %_✓b.
  2158.  
  2159.       %✓%✓%✓%B✓B✓B✓B   Depressing the button causes MGR to move a rectangle in response  to
  2160.            moving  the  mouse, in a manner similar to the system _✓m_✓o_✓v_✓e function.
  2161.            The initial parameters set the initial width and height of the  rec-
  2162.            tangle  to be moved.  When the button is released, the current coor-
  2163.            dinates of the box's corner is returned in _✓d_✓i_✓s_✓p_✓l_✓a_✓y coordinates, sub-
  2164.            stituted for the %_✓b.
  2165.  
  2166.       %✓%✓%✓%l✓l✓l✓l   Depressing the button causes MGR to sweep out a line.   One  end  of
  2167.            the  line remains fixed at the _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s _✓p_✓o_✓i_✓n_✓t while the other end of
  2168.            the line tracks the mouse position.  The initial end  point  of  the
  2169.            line  may  be specified as a displacement from the graphics point as
  2170.            part of the initial parameters.  When the button  is  released,  the
  2171.            coordinates of the _✓s_✓t_✓a_✓r_✓t_✓i_✓n_✓g and _✓e_✓n_✓d_✓i_✓n_✓g points of the line, in _✓w_✓i_✓n_✓d_✓o_✓w
  2172.            coordinates, are substituted for the %_✓l.
  2173.  
  2174.  
  2175.  
  2176.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  MGR-C Language Application Interface- 31 -                          Macros
  2183.  
  2184.  
  2185.       %✓%✓%✓%t✓t✓t✓t   Depressing the button causes MGR to sweep  out  text,  in  a  manner
  2186.            equivalent to the system _✓c_✓u_✓t function.  Upon the release of the but-
  2187.            ton, the %_✓t is replaced by the starting character coordinate of  the
  2188.            _✓c_✓u_✓t  region,  followed  by character distance to the ending point in
  2189.            columns and lines  respectively.   For  example,  The  event  string
  2190.            _✓s_✓w_✓e_✓e_✓p[%✓%✓%✓%t✓t✓t✓t]  might  return  _✓s_✓w_✓e_✓e_✓p[1✓1✓1✓17✓7✓7✓7 5✓5✓5✓5 6✓6✓6✓6 0✓0✓0✓0], indicating the user swept
  2191.            out a six character word on a single line, starting  on  c✓c✓c✓co✓o✓o✓ol✓l✓l✓lu✓u✓u✓um✓m✓m✓mn✓n✓n✓n  17,
  2192.            r✓r✓r✓ro✓o✓o✓ow✓w✓w✓w  5.   An  inital  size  may  ber specified in number of rows and
  2193.            number of columns.
  2194.       The remaining format specifiers are replaced by the information described
  2195.       below No sweep action is performed.
  2196.  
  2197.       %✓%✓%✓%p✓p✓p✓p   The %_✓p is replaced by the current mouse coordinates, in _✓w_✓i_✓n_✓d_✓o_✓w coor-
  2198.            dinates.
  2199.  
  2200.       %✓%✓%✓%P✓P✓P✓P   The %_✓P is replaced by the current mouse  coordinates,  in  _✓c_✓h_✓a_✓r_✓a_✓c_✓t_✓e_✓r
  2201.            coordinates.
  2202.  
  2203.       %✓%✓%✓%n✓n✓n✓n   If the mouse cursor is over a window whose N✓N✓N✓NO✓O✓O✓OT✓T✓T✓TI✓I✓I✓IF✓F✓F✓FY✓Y✓Y✓Y event is set,  the
  2204.            text of that message is substituted for the %_✓n.
  2205.  
  2206.       %✓%✓%✓%w✓w✓w✓w   If the mouse cursor is over a window whose N✓N✓N✓NO✓O✓O✓OT✓T✓T✓TI✓I✓I✓IF✓F✓F✓FY✓Y✓Y✓Y event is set,  the
  2207.            w✓w✓w✓wi✓i✓i✓in✓n✓n✓nd✓d✓d✓do✓o✓o✓ow✓w✓w✓w_✓_✓_✓_i✓i✓i✓id✓d✓d✓d  of the clicked on window is substituted for the %_✓w.  This
  2208.            w✓w✓w✓wi✓i✓i✓in✓n✓n✓nd✓d✓d✓do✓o✓o✓ow✓w✓w✓w_✓_✓_✓_i✓i✓i✓id✓d✓d✓d may be used by m_sendto()to send the clicked-on  window  a
  2209.            message.
  2210.  
  2211.       %✓%✓%✓%S✓S✓S✓S   If the mouse cursor is over a window whose N✓N✓N✓NO✓O✓O✓OT✓T✓T✓TI✓I✓I✓IF✓F✓F✓FY✓Y✓Y✓Y event is set,  the
  2212.            length of that message is substituted for the %_✓S.
  2213.  
  2214.       The A✓A✓A✓AC✓C✓C✓CC✓C✓C✓CE✓E✓E✓EP✓P✓P✓PT✓T✓T✓T event is used to receive messages from other client  programs.
  2215.       The  following substituteable parameters may be used as part of the event
  2216.       string.
  2217.  
  2218.       %✓%✓%✓%f✓f✓f✓f   The w✓w✓w✓wi✓i✓i✓in✓n✓n✓nd✓d✓d✓do✓o✓o✓ow✓w✓w✓w_✓_✓_✓_i✓i✓i✓id✓d✓d✓d of message sender, as used in m_sendto(), replaces the
  2219.            %_✓f.
  2220.  
  2221.       %✓%✓%✓%m✓m✓m✓m   The text of message sent by the other client program replaces the %_✓m
  2222.  
  2223.       %✓%✓%✓%s✓s✓s✓s   The length of the message, in  characters,  replaces  the  %_✓s.   For
  2224.            example, a call to
  2225.                 __________________________________________________________
  2226.                |✓|_m✓__✓_s✓_e✓_t✓_e✓_v✓_e✓_n✓_t✓_(✓_A✓_C✓_C✓_E✓_P✓_T✓_,✓_"✓_M✓_e✓_s✓_s✓_a✓_g✓_e✓__f✓_r✓_o✓_m✓__(✓_%✓_✓%✓%✓%f✓_✓f✓f✓f)✓_,✓__(✓_%✓_✓%✓%✓%s✓_✓s✓s✓s)✓__l✓_o✓_n✓_g✓__i✓_s✓_:✓__%✓_✓%✓%✓%m✓_✓m✓m✓m"✓_)✓__✓|✓|
  2227.            might cause MGR to return
  2228.                           ______________________________________
  2229.                          |✓|_M✓_e✓_s✓_s✓_a✓_g✓_e✓__f✓_r✓_o✓_m✓__(✓_3✓_✓3✓3✓32✓_✓2✓2✓21✓_✓1✓1✓14✓_✓4✓4✓4)✓_,✓__(✓_2✓_✓2✓2✓2)✓__l✓_o✓_n✓_g✓__i✓_s✓_:✓__H✓_✓H✓H✓HI✓_✓I✓I✓I_✓|✓|
  2230.            after the client program whose _✓w_✓i_✓n_✓d_✓o_✓w _✓i_✓d is _✓3_✓2_✓1_✓4  uses  m_sendto()to
  2231.            send the message "_✓H_✓I".
  2232.  
  2233.       %✓%✓%✓%p✓p✓p✓p   As with the B✓B✓B✓BU✓U✓U✓UT✓T✓T✓TT✓T✓T✓TO✓O✓O✓ON✓N✓N✓N events above, %_✓p is replaced by the current mouse
  2234.            position in _✓w_✓i_✓n_✓d_✓o_✓w coordinates.
  2235.  
  2236.       %✓%✓%✓%P✓P✓P✓P   As with the B✓B✓B✓BU✓U✓U✓UT✓T✓T✓TT✓T✓T✓TO✓O✓O✓ON✓N✓N✓N events above, %_✓P is replaced by the current mouse
  2237.            position in _✓c_✓h_✓a_✓r_✓a_✓c_✓t_✓e_✓r coordinates.
  2238.       For the S✓S✓S✓SN✓N✓N✓NA✓A✓A✓AR✓R✓R✓RF✓F✓F✓FE✓E✓E✓ED✓D✓D✓D event string, the following substitution  parameters  are
  2239.  
  2240.  
  2241.  
  2242.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  MGR-C Language Application Interface- 32 -                          Macros
  2249.  
  2250.  
  2251.       recognized.
  2252.  
  2253.       %✓%✓%✓%f✓f✓f✓f   The _✓w_✓i_✓n_✓d_✓o_✓w _✓i_✓d of the window filling the _✓s_✓n_✓a_✓r_✓f  buffer  replaces  the
  2254.            %_✓f.
  2255.  
  2256.       %✓%✓%✓%c✓c✓c✓c   The current length of the _✓s_✓n_✓a_✓r_✓f buffer, in characters, replaces  the
  2257.            %_✓c.
  2258.  
  2259.       %✓%✓%✓%C✓C✓C✓C   The contents of the _✓s_✓n_✓a_✓r_✓f buffer replaces the %_✓C.  At present,  only
  2260.            the first 250 characters of the _✓s_✓n_✓a_✓r_✓f buffer may be returned via the
  2261.            %_✓C parameter.  Use m_snarf()to read the entire buffer.
  2262.  
  2263.       The P✓P✓P✓PA✓A✓A✓AS✓S✓S✓ST✓T✓T✓TE✓E✓E✓E event string, recognizes the %_✓c specifier  as  described  under
  2264.       _✓S_✓N_✓A_✓R_✓F_✓E_✓D above.
  2265.  
  2266.  m_setmode( m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e)
  2267.       Various window modes may be _✓s_✓e_✓t or _✓c_✓l_✓e_✓a_✓r_✓e_✓d (see  m_clearmode())  indepen-
  2268.       dently.  These modes are:
  2269.  
  2270.       M✓M✓M✓M_✓_✓_✓_S✓S✓S✓ST✓T✓T✓TA✓A✓A✓AN✓N✓N✓ND✓D✓D✓DO✓O✓O✓OU✓U✓U✓UT✓T✓T✓T
  2271.            The window is put in standout mode.  All characters are written with
  2272.            their foreground and background colors reversed.
  2273.  
  2274.       M✓M✓M✓M_✓_✓_✓_W✓W✓W✓WO✓O✓O✓OB✓B✓B✓BThe sense of _✓w_✓h_✓i_✓t_✓e and _✓b_✓l_✓a_✓c_✓k is reversed for the entire window,  not
  2275.            just for characters as is _✓M__✓S_✓T_✓A_✓N_✓D_✓O_✓U_✓T.
  2276.  
  2277.       M✓M✓M✓M_✓_✓_✓_A✓A✓A✓AU✓U✓U✓UT✓T✓T✓TO✓O✓O✓OE✓E✓E✓EX✓X✓X✓XP✓P✓P✓PO✓O✓O✓OS✓S✓S✓SE✓E✓E✓E
  2278.            The next character to be typed on the window causes it to  automati-
  2279.            cally become the _✓a_✓c_✓t_✓i_✓v_✓e window.
  2280.  
  2281.       M✓M✓M✓M_✓_✓_✓_B✓B✓B✓BA✓A✓A✓AC✓C✓C✓CK✓K✓K✓KG✓G✓G✓GR✓R✓R✓RO✓O✓O✓OU✓U✓U✓UN✓N✓N✓ND✓D✓D✓D
  2282.            Output goes to the  window  even  if  it  is  partially  or  totally
  2283.            obscured.   The  data  in  exposed  portions  of  the window is seen
  2284.            immediately.  Data in covered portions of the window is saved by MGR
  2285.            and restored when the covered portions are exposed.
  2286.  
  2287.       M✓M✓M✓M_✓_✓_✓_N✓N✓N✓NO✓O✓O✓OI✓I✓I✓IN✓N✓N✓NP✓P✓P✓PU✓U✓U✓UT✓T✓T✓T
  2288.            Keyboard input is prohibited.  All input from the keyboard  is  held
  2289.            buffered  by  MGR  until either _✓M__✓N_✓O_✓I_✓N_✓P_✓U_✓T is cleared, or a different
  2290.            window is made the _✓a_✓c_✓t_✓i_✓v_✓e window.  In the latter case the input goes
  2291.            to  the  newly  activated window.  This flag is automatically turned
  2292.            off when the user activates the window.  This feature is for  client
  2293.            programs  that  want  one of their windows to come to the front just
  2294.            long enough to notify the user of some event, but  do  not  want  to
  2295.            accidently intercept keyboard input while the user is merrily typing
  2296.            to some other client.
  2297.  
  2298.       M✓M✓M✓M_✓_✓_✓_N✓N✓N✓NO✓O✓O✓OW✓W✓W✓WR✓R✓R✓RA✓A✓A✓AP✓P✓P✓P
  2299.            The character cursor does not automatically jump to the left edge of
  2300.            the  next  line  as  it  reaches  the right edge of its text region.
  2301.            After the right margin is passed, the cursor and any subsequent text
  2302.            disappear past the right edge of the window.
  2303.  
  2304.       M✓M✓M✓M_✓_✓_✓_O✓O✓O✓OV✓V✓V✓VE✓E✓E✓ER✓R✓R✓RS✓S✓S✓ST✓T✓T✓TR✓R✓R✓RI✓I✓I✓IK✓K✓K✓KE✓E✓E✓E
  2305.  
  2306.  
  2307.  
  2308.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.  MGR-C Language Application Interface- 33 -                          Macros
  2315.  
  2316.  
  2317.            Text is written to the window with the mode  specified  by  m_func()
  2318.            instead  of the normal copy mode.  In copy mode, the characters com-
  2319.            pletely obliterate their destination instead of combining with it.
  2320.  
  2321.       M✓M✓M✓M_✓_✓_✓_A✓A✓A✓AB✓B✓B✓BS✓S✓S✓S
  2322.            The window is set to _✓a_✓b_✓s_✓o_✓l_✓u_✓t_✓e coordinate mode.  The upper left  edge
  2323.            of  the  window,  just inside the border is at position ( 0✓0✓0✓0,0✓0✓0✓0).  All
  2324.            other locations are measured relative to that corner in pixels.
  2325.  
  2326.       M✓M✓M✓M_✓_✓_✓_A✓A✓A✓AC✓C✓C✓CT✓T✓T✓TI✓I✓I✓IV✓V✓V✓VA✓A✓A✓AT✓T✓T✓TE✓E✓E✓E
  2327.            The window is made the _✓a_✓c_✓t_✓i_✓v_✓e window,  pops  to  the  front  of  the
  2328.            display, and obtains all keyboard and mouse input.
  2329.  
  2330.       M✓M✓M✓M_✓_✓_✓_S✓S✓S✓SN✓N✓N✓NA✓A✓A✓AR✓R✓R✓RF✓F✓F✓FL✓L✓L✓LI✓I✓I✓IN✓N✓N✓NE✓E✓E✓ES✓S✓S✓S
  2331.            The system _✓c_✓u_✓t function only cuts entire lines.  If any  text  on  a
  2332.            line is swept out, the entire line of text is included.
  2333.  
  2334.       M✓M✓M✓M_✓_✓_✓_S✓S✓S✓SN✓N✓N✓NA✓A✓A✓AR✓R✓R✓RF✓F✓F✓FT✓T✓T✓TA✓A✓A✓AB✓B✓B✓BS✓S✓S✓S
  2335.            The system _✓c_✓u_✓t function attempts to turn white space into a  minimal
  2336.            combination of spaces and tabs.  Tab are set at every 8 columns.
  2337.  
  2338.       M✓M✓M✓M_✓_✓_✓_S✓S✓S✓SN✓N✓N✓NA✓A✓A✓AR✓R✓R✓RF✓F✓F✓FH✓H✓H✓HA✓A✓A✓AR✓R✓R✓RD✓D✓D✓D
  2339.            The system _✓c_✓u_✓t function attempts to cut text even if the window con-
  2340.            tents  have  been corrupted.  Unidentifyable characters are returned
  2341.            as _✓C__✓N_✓O_✓C_✓H_✓A_✓R ('?').
  2342.  
  2343.       M✓M✓M✓M_✓_✓_✓_S✓S✓S✓ST✓T✓T✓TA✓A✓A✓AC✓C✓C✓CK✓K✓K✓K
  2344.            Any events pushed on the window stack when this flag is set will  be
  2345.            sent  in  addition  to  any currently active events. This setting is
  2346.            useful for filters which need to receive events,  yet  still  permit
  2347.            clients running under them to receive events as well.
  2348.  
  2349.  m_setnoecho()
  2350.       Character echoing to the window is disabled if possible.  Character echo-
  2351.       ing  is  normally disabled by clients to inhibit information from MGR, as
  2352.       from calls to m_getinfo() from echoing on the window.
  2353.  
  2354.  m_setnoraw()
  2355.       Normal terminal input processing is in  effect.   Input  is  buffered  by
  2356.       lines,  and all normal line editting and keyboard interrupt generation is
  2357.       in effect.
  2358.  
  2359.  m_setraw()
  2360.       Every character is available as entered, no  input  processing  is  done.
  2361.       This  is typically called _✓r_✓a_✓w mode.  Raw mode is not always available, in
  2362.       which case the macro call is ignored.
  2363.  
  2364.  m_shapewindow( X✓X✓X✓X,Y✓Y✓Y✓Y,D✓D✓D✓Dw✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h,D✓D✓D✓Dh✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t)
  2365.       The window is reshaped to  position  (  X✓X✓X✓X,Y✓Y✓Y✓Y)  and  with  size  D✓D✓D✓Dw✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h  by
  2366.       D✓D✓D✓Dh✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t.     As    only    the    _✓a_✓c_✓t_✓i_✓v_✓e    window   may   be   reshaped,
  2367.       m_shapewindow()activates the window if it is not already active.  The new
  2368.       size  of  the  window is not guaranteed; the _✓w_✓i_✓d_✓t_✓h or _✓h_✓e_✓i_✓g_✓h_✓t may be trun-
  2369.       cated  to  the  right  or  bottom  edges  of  the  display.   The   macro
  2370.       m_getinfo()can be used to determine the actual window size.
  2371.  
  2372.  
  2373.  
  2374.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.  MGR-C Language Application Interface- 34 -                          Macros
  2381.  
  2382.  
  2383.  m_size( c✓c✓c✓co✓o✓o✓ol✓l✓l✓lu✓u✓u✓um✓m✓m✓mn✓n✓n✓ns✓s✓s✓s,r✓r✓r✓ro✓o✓o✓ow✓w✓w✓ws✓s✓s✓s)
  2384.       The size of the window is changed so that it fits exactly c✓c✓c✓co✓o✓o✓ol✓l✓l✓lu✓u✓u✓um✓m✓m✓mn✓n✓n✓ns✓s✓s✓s by r✓r✓r✓ro✓o✓o✓ow✓w✓w✓ws✓s✓s✓s
  2385.       of  characters  in  the current font.  The window may be truncated at the
  2386.       right or bottom edge of the display if it is too  large  to  fit  on  the
  2387.       display at its current position.
  2388.  
  2389.  m_sizeall( X✓X✓X✓X,Y✓Y✓Y✓Y,c✓c✓c✓co✓o✓o✓ol✓l✓l✓lu✓u✓u✓um✓m✓m✓mn✓n✓n✓ns✓s✓s✓s,r✓r✓r✓ro✓o✓o✓ow✓w✓w✓ws✓s✓s✓s)
  2390.       The window is reshaped to position ( X✓X✓X✓X,Y✓Y✓Y✓Y) on the display, and resized  to
  2391.       fit c✓c✓c✓co✓o✓o✓ol✓l✓l✓lu✓u✓u✓um✓m✓m✓mn✓n✓n✓ns✓s✓s✓s and r✓r✓r✓ro✓o✓o✓ow✓w✓w✓ws✓s✓s✓s of text.  As only the _✓a_✓c_✓t_✓i_✓v_✓e window may be reshaped,
  2392.       m_shapewindow() activates the window if it is not  already  active.   The
  2393.       new  size  of  the  window  is not guaranteed; the _✓w_✓i_✓d_✓t_✓h or _✓h_✓e_✓i_✓g_✓h_✓t may be
  2394.       truncated to the right  or  bottom  edges  of  the  display.   The  macro
  2395.       m_getinfo()can be used to determine the actual window size.
  2396.  
  2397.  m_snarf()
  2398.       The application is sent the contents of the global snarf buffer, if  any,
  2399.       as  specified by the last call by a client programs call to m_put() or by
  2400.       use of the system _✓c_✓u_✓t function.
  2401.  
  2402.  m_sleep()
  2403.       This call causes MGR to suspend the processing of characters to the  win-
  2404.       dow.   After  a chunk of output for all other windows has been processed,
  2405.       output processing resumes.  This does not normally take very long, making
  2406.       m_sleep() almost a _✓n_✓o-_✓o_✓p.
  2407.  
  2408.  m_standend()
  2409.       Inverse video mode as set by m_standout() is turned off.  This is exactly
  2410.       equivalent to m_clearmode( M✓M✓M✓M_✓_✓_✓_S✓S✓S✓ST✓T✓T✓TA✓A✓A✓AN✓N✓N✓ND✓D✓D✓DO✓O✓O✓OU✓U✓U✓UT✓T✓T✓T).
  2411.  
  2412.  m_standout()
  2413.       Inverse  video  mode  is  turned  on.   This  is  exactly  equivalent  to
  2414.       m_setmode(  M✓M✓M✓M_✓_✓_✓_S✓S✓S✓ST✓T✓T✓TA✓A✓A✓AN✓N✓N✓ND✓D✓D✓DO✓O✓O✓OU✓U✓U✓UT✓T✓T✓T).   The  color  of  the characters and their back-
  2415.       grounds are interchanged.
  2416.  
  2417.  m_stringto( t✓t✓t✓to✓o✓o✓o,x✓x✓x✓x_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,y✓y✓y✓y_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g)
  2418.       The text s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g is printed starting at the  location  (  x✓x✓x✓x_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t,y✓y✓y✓y_✓_✓_✓_d✓d✓d✓ds✓s✓s✓st✓t✓t✓t)  on
  2419.       _✓s_✓c_✓r_✓a_✓t_✓c_✓h_✓p_✓a_✓d  bitmap  t✓t✓t✓to✓o✓o✓o.  The text is clipped to fit in the bitmap, and no
  2420.       special command processing is done on s✓s✓s✓st✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g.✓.✓.✓.  If t✓t✓t✓to✓o✓o✓o  is  0  (zero),  The
  2421.       text  is  printed  on the window, but _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n boundaries are ignored.
  2422.       This is the only way to get text  into  a  window  outside  of  the  _✓t_✓e_✓x_✓t
  2423.       _✓r_✓e_✓g_✓i_✓o_✓n.
  2424.  
  2425.  m_textregion( x✓x✓x✓x,y✓y✓y✓y,w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e,h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h)
  2426.       A subregion within the current window starting at ( x✓x✓x✓x,y✓y✓y✓y) and of size w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e
  2427.       by  h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h  is  defined within which all text is restricted.  All functions
  2428.       and information that deals in _✓c_✓h_✓a_✓r_✓a_✓c_✓t_✓e_✓r coordinates views the text region
  2429.       as  if  it was the entire window.  As soon as the text region is defined,
  2430.       the character cursor is moved to row and column  (  0✓0✓0✓0,0✓0✓0✓0),  which  is  now
  2431.       located  at  the  point  ( x✓x✓x✓x,y✓y✓y✓y).  Graphics output is not affected by text
  2432.       regions.
  2433.  
  2434.  m_textreset()
  2435.       The _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n (defined by a call to m_textregion()) is reset to be  the
  2436.       entire window.  This is the default setting.
  2437.  
  2438.  
  2439.  
  2440.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446.  MGR-C Language Application Interface- 35 -                          Macros
  2447.  
  2448.  
  2449.  m_unlinkmenu( p✓p✓p✓pa✓a✓a✓ar✓r✓r✓re✓e✓e✓en✓n✓n✓nt✓t✓t✓t,i✓i✓i✓it✓t✓t✓te✓e✓e✓em✓m✓m✓m)
  2450.       The menu link associating a child menu  with  the  menu  p✓p✓p✓pa✓a✓a✓ar✓r✓r✓re✓e✓e✓en✓n✓n✓nt✓t✓t✓t  at  i✓i✓i✓it✓t✓t✓te✓e✓e✓em✓m✓m✓m
  2451.       (counting  from  zero) is removed (see also m_linkmenu()).  This function
  2452.       does not change the menus, only their connections.
  2453.  
  2454.  m_unpagemenu( p✓p✓p✓pa✓a✓a✓ar✓r✓r✓re✓e✓e✓en✓n✓n✓nt✓t✓t✓t)
  2455.       The link associating the menu p✓p✓p✓pa✓a✓a✓ar✓r✓r✓re✓e✓e✓en✓n✓n✓nt✓t✓t✓t with a _✓c_✓h_✓i_✓l_✓d menu is  removed.   See
  2456.       also m_pagemenu().
  2457.  
  2458.  m_up( n✓n✓n✓n)
  2459.       Move the character cursor up n✓n✓n✓n tenths of a character  height.   This  may
  2460.       cause the window to scroll down.  See also m_left()m_right()and m_down().
  2461.  
  2462.  m_whatsat( X✓X✓X✓X,Y✓Y✓Y✓Y)
  2463.       MGR returns to the client program  a  line  indicating  what  is  at  the
  2464.       _✓d_✓i_✓s_✓p_✓l_✓a_✓y  coordinates ( X✓X✓X✓X,Y✓Y✓Y✓Y).  If that location is occupied by a window, a
  2465.       line containing  the  window's  controlling  terminal,  alternate  window
  2466.       number,  and  _✓w_✓i_✓n_✓d_✓o_✓w  _✓i_✓d  is  returned in a space separated list.  If the
  2467.       location ( X✓X✓X✓X,Y✓Y✓Y✓Y) is not in a window, MGR returns a newline.
  2468.  
  2469.  m_windowsave( n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e)
  2470.       The current image contents of the window is saved in the file n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e on the
  2471.       MGR-host  machine  in  MGR bitmap format.  File names beginning with "./"
  2472.       are evaluated relative to the current directory  when  MGR  was  started.
  2473.       See also m_othersave() and m_bitsave().
  2474.  
  2475.  
  2476.  
  2477.  
  2478.  
  2479.  
  2480.  
  2481.  
  2482.  
  2483.  
  2484.  
  2485.  
  2486.  
  2487.  
  2488.  
  2489.  
  2490.  
  2491.  
  2492.  
  2493.  
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503.  
  2504.  
  2505.  
  2506.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  MGR-C Language Application Interface- 36 -                       Functions
  2513.  
  2514.  
  2515.  => _✓F_✓u_✓n_✓c_✓t_✓i_✓o_✓n_✓s
  2516.  
  2517.  The functions listed below have  packaged  common  sequences  of  _✓m_✓a_✓c_✓r_✓o  calls
  2518.  together  to  provide  a  slightly  higher  level of interface than the macros
  2519.  alone.  They are still low level, and have no pretense of completeness. Except
  2520.  where noted, all of the functions return a value greater than zero on success,
  2521.  and a value less than zero upon failure.  The functions fail only if they read
  2522.  an   unexpected  value  from  MGR.   Client  programs  may  use  the  function
  2523.  m_lastline()in an attempt to determine what input caused the  failure.   Those
  2524.  functions  which  expect  data from MGR automatically flush any pending output
  2525.  before reading, and unless the _✓M__✓M_✓O_✓D_✓E_✓O_✓K flag is set, attempt to turn off char-
  2526.  acter echoing to prevent data returned by MGR from echoing back on the window.
  2527.  
  2528.  
  2529.  int
  2530.  get_all( l✓l✓l✓li✓i✓i✓is✓s✓s✓st✓t✓t✓t)
  2531.  struct window_data *list;
  2532.  
  2533.       The current position size and status of all windows  on  the  display  is
  2534.       returned  in  l✓l✓l✓li✓i✓i✓is✓s✓s✓st✓t✓t✓t.  The number of in windows on the display is returned.
  2535.       L✓L✓L✓Li✓i✓i✓is✓s✓s✓st✓t✓t✓t should be large enough to hold a status entry for each window.   The
  2536.       _✓w_✓i_✓n_✓d_✓o_✓w__✓d_✓a_✓t_✓a structure is defined in _✓t_✓e_✓r_✓m._✓h.
  2537.  
  2538.  int
  2539.  get_client( l✓l✓l✓li✓i✓i✓is✓s✓s✓st✓t✓t✓t)
  2540.  struct window_data *list;
  2541.       The current position size and status of  the  client  programs  _✓m_✓a_✓i_✓n  and
  2542.       _✓a_✓l_✓t_✓e_✓r_✓n_✓a_✓t_✓e  windows  is  returned in l✓l✓l✓li✓i✓i✓is✓s✓s✓st✓t✓t✓t.  The number of windows owned by
  2543.       the client program is returned.  L✓L✓L✓Li✓i✓i✓is✓s✓s✓st✓t✓t✓t should be large enough  to  hold  a
  2544.       status  entry  for  each window.  The _✓w_✓i_✓n_✓d_✓o_✓w__✓d_✓a_✓t_✓a structure is defined in
  2545.       _✓t_✓e_✓r_✓m._✓h.
  2546.  
  2547.  int
  2548.  get_colrow( c✓c✓c✓co✓o✓o✓ol✓l✓l✓lu✓u✓u✓um✓m✓m✓mn✓n✓n✓ns✓s✓s✓s,r✓r✓r✓ro✓o✓o✓ow✓w✓w✓ws✓s✓s✓s)
  2549.  int *columns, *rows;
  2550.  
  2551.       The number of _✓c_✓o_✓l_✓u_✓m_✓n_✓s and _✓r_✓o_✓w_✓s in the current _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n is returned  in
  2552.       c✓c✓c✓co✓o✓o✓ol✓l✓l✓lu✓u✓u✓um✓m✓m✓mn✓n✓n✓ns✓s✓s✓s  and  r✓r✓r✓ro✓o✓o✓ow✓w✓w✓ws✓s✓s✓s  respectively.   For  any  _✓N_✓U_✓L_✓L  argument, no value is
  2553.       returned.
  2554.  
  2555.  int
  2556.  get_cursor( c✓c✓c✓co✓o✓o✓ol✓l✓l✓lu✓u✓u✓um✓m✓m✓mn✓n✓n✓n,r✓r✓r✓ro✓o✓o✓ow✓w✓w✓w)
  2557.  int *column, *row;
  2558.       The current _✓c_✓h_✓a_✓r_✓a_✓c_✓t_✓e_✓r cursor position is placed in c✓c✓c✓co✓o✓o✓ol✓l✓l✓lu✓u✓u✓um✓m✓m✓mn✓n✓n✓n and  r✓r✓r✓ro✓o✓o✓ow✓w✓w✓w.   For
  2559.       any _✓N_✓U_✓L_✓L argument, no value is returned.
  2560.  
  2561.  int
  2562.  get_eachclientwin( w✓w✓w✓wi✓i✓i✓in✓n✓n✓nd✓d✓d✓da✓a✓a✓at✓t✓t✓ta✓a✓a✓ap✓p✓p✓p)
  2563.  struct window_data *windatap;
  2564.  
  2565.       Get the window parameters for each window in the current window set,  one
  2566.       window  at  a time.  This function returns 1 if window_data structure has
  2567.       been filled, 0 otherwise.  It is important to call get_eachcleintwin() in
  2568.       a  tight  loop that doesn't exit until it returns 0, so that all the data
  2569.       is picked up.  This function is preferred  to  get_client()  because  you
  2570.  
  2571.  
  2572.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  MGR-C Language Application Interface- 37 -                       Functions
  2579.  
  2580.  
  2581.       don't need to know the maximum number of windows you are likely to see.
  2582.  
  2583.  int
  2584.  get_eachwin( w✓w✓w✓wi✓i✓i✓in✓n✓n✓nd✓d✓d✓da✓a✓a✓at✓t✓t✓ta✓a✓a✓ap✓p✓p✓p)
  2585.  struct window_data *windatap;
  2586.  
  2587.       Get the window parameters for all the windows,  one  window  at  a  time.
  2588.       This  function returns 1 if window_data structure has been filled, 0 oth-
  2589.       erwise.  It is important to call  get_eachwin()  in  a  tight  loop  that
  2590.       doesn't exit until it returns 0, so that all the data is picked up.  This
  2591.       function is preferred to get_all() because you don't  need  to  know  the
  2592.       maximum number of windows you are likely to see.
  2593.  
  2594.  int
  2595.  get_font( w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e,h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h)
  2596.  int  *wide, *high;
  2597.       The character size of the current font, in pixels is placed in  w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e  and
  2598.       h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h.  For any _✓N_✓U_✓L_✓L argument, no value is returned.  The function returns
  2599.       the current font number, as would be used in a call to m_font().
  2600.  
  2601.  int
  2602.  get_mouse( x✓x✓x✓x,y✓y✓y✓y)
  2603.  int *x, *y;
  2604.  
  2605.       The current mouse position, in _✓w_✓i_✓n_✓d_✓o_✓w coordinates, is placed in x✓x✓x✓x and  y✓y✓y✓y.
  2606.       For  any  _✓N_✓U_✓L_✓L  argument, no value is returned.  The function returns the
  2607.       current mouse button state, which is in the range of -2 to +2  upon  suc-
  2608.       cess,  a  value less than -2 upon failure.  See m_getinfo( G✓G✓G✓G_✓_✓_✓_M✓M✓M✓MO✓O✓O✓OU✓U✓U✓US✓S✓S✓SE✓E✓E✓E) for a
  2609.       discussion of the return values.
  2610.  
  2611.  int
  2612.  get_param( h✓h✓h✓ho✓o✓o✓os✓s✓s✓st✓t✓t✓t,x✓x✓x✓xm✓m✓m✓ma✓a✓a✓ax✓x✓x✓x,y✓y✓y✓ym✓m✓m✓ma✓a✓a✓ax✓x✓x✓x,b✓b✓b✓bo✓o✓o✓or✓r✓r✓rd✓d✓d✓de✓e✓e✓er✓r✓r✓r)
  2613.  char *host;
  2614.  int *xmax, *ymax, *border;
  2615.       The _✓M_✓G_✓R-_✓h_✓o_✓s_✓t, display size (in pixels) and window border size (in pixels)
  2616.       is  placed  in  the  arguments  h✓h✓h✓ho✓o✓o✓os✓s✓s✓st✓t✓t✓t,x✓x✓x✓xm✓m✓m✓ma✓a✓a✓ax✓x✓x✓x,y✓y✓y✓ym✓m✓m✓ma✓a✓a✓ax✓x✓x✓x, and b✓b✓b✓bo✓o✓o✓or✓r✓r✓rd✓d✓d✓de✓e✓e✓er✓r✓r✓r.  For any _✓N_✓U_✓L_✓L
  2617.       argument, no value is returned.
  2618.  
  2619.  int
  2620.  get_size( X✓X✓X✓X,Y✓Y✓Y✓Y,D✓D✓D✓Dw✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h,D✓D✓D✓Dh✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t)
  2621.  int *X, *Y, *Dwidth, *Dheight;
  2622.  
  2623.       The position of the window on the  display,  in  _✓d_✓i_✓s_✓p_✓l_✓a_✓y  coordinates  is
  2624.       placed  into  X✓X✓X✓X,Y✓Y✓Y✓Y,D✓D✓D✓Dw✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h and D✓D✓D✓Dh✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t.  For any _✓N_✓U_✓L_✓L argument, no value is
  2625.       returned.
  2626.  
  2627.  char *
  2628.  get_termcap()
  2629.       A string containing a  _✓T_✓E_✓R_✓M_✓C_✓A_✓P  entry,  suitable  for  placing  into  the
  2630.       _✓T_✓E_✓R_✓M_✓C_✓A_✓P  environment  variable  is  returned.  The function get_termcap()
  2631.       returns _✓N_✓U_✓L_✓L upon failure.
  2632.  
  2633.  int
  2634.  is_active()
  2635.  
  2636.  
  2637.  
  2638.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.  MGR-C Language Application Interface- 38 -                       Functions
  2645.  
  2646.  
  2647.       The function is_active() returns _✓T_✓R_✓U_✓E if the window is the _✓a_✓c_✓t_✓i_✓v_✓e  window
  2648.       .
  2649.  
  2650.  void
  2651.  menu_load( n✓n✓n✓n,c✓c✓c✓co✓o✓o✓ou✓u✓u✓un✓n✓n✓nt✓t✓t✓t,t✓t✓t✓te✓e✓e✓ex✓x✓x✓xt✓t✓t✓t)
  2652.  int n;
  2653.  int count;
  2654.  struct menu_entry *text;
  2655.  
  2656.       A menu is downloaded to MGR at position n✓n✓n✓n.   The  integer  c✓c✓c✓co✓o✓o✓ou✓u✓u✓un✓n✓n✓nt✓t✓t✓t  is  the
  2657.       number  of  menu  items  to  be down-loaded, and t✓t✓t✓te✓e✓e✓ex✓x✓x✓xt✓t✓t✓t is an array of menu
  2658.       item/value pairs.  The structure _✓m_✓e_✓n_✓u__✓e_✓n_✓t_✓r_✓y is defined in _✓t_✓e_✓r_✓m._✓h.
  2659.  
  2660.  int
  2661.  m_bitfile( t✓t✓t✓to✓o✓o✓o,n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e,w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓ep✓p✓p✓p,h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓hp✓p✓p✓p)
  2662.  int to;
  2663.  char *name;
  2664.  int *widep, *highp;
  2665.       Given a bitmap id, t✓t✓t✓to✓o✓o✓o and an icon n✓n✓n✓na✓a✓a✓am✓m✓m✓me✓e✓e✓e, have MGR load that icon into that
  2666.       scratchpad  bitmap,  returning  the icon width and height, in pixels, via
  2667.       the given integer pointers.  Return a positive number if successful.   If
  2668.       the  icon  is not loaded, set the width and height values to 0 and return
  2669.       0.  This function is identical to m_bitfromfile()plus the  needed  inter-
  2670.       ception of the line returned from MGR.
  2671.  
  2672.  void
  2673.  m_bitload( x✓x✓x✓x,y✓y✓y✓y,w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e,h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h,d✓d✓d✓da✓a✓a✓at✓t✓t✓ta✓a✓a✓a)
  2674.  int x,y;
  2675.  int wide,high;
  2676.  register char *data;
  2677.  
  2678.       The bitmap image pointed at by d✓d✓d✓da✓a✓a✓at✓t✓t✓ta✓a✓a✓a is down-loaded to the window at posi-
  2679.       tion  (  x✓x✓x✓x,y✓y✓y✓y)  in  _✓w_✓i_✓n_✓d_✓o_✓w coordinates.  It is up to the client program to
  2680.       insure an 8 bit channel exists between the client and MGR.  The  integers
  2681.       w✓w✓w✓wi✓i✓i✓id✓d✓d✓de✓e✓e✓e and h✓h✓h✓hi✓i✓i✓ig✓g✓g✓gh✓h✓h✓h specify the size of the bitmap in pixels.
  2682.  
  2683.  char *
  2684.  m_lastline()
  2685.       The last input from MGR to a library function is returned.  The  data  is
  2686.       kept in a static buffer which is overwritten at each request.
  2687.  
  2688.  int
  2689.  m_makewindow( X✓X✓X✓X,Y✓Y✓Y✓Y,D✓D✓D✓Dw✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h,D✓D✓D✓Dh✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t)
  2690.  int  X, Y, Dwidth, Dheight;
  2691.  
  2692.       An alternate window is created as the _✓a_✓c_✓t_✓i_✓v_✓e window, at  display  coordi-
  2693.       nates  ( X✓X✓X✓X,Y✓Y✓Y✓Y) and of size D✓D✓D✓Dw✓w✓w✓wi✓i✓i✓id✓d✓d✓dt✓t✓t✓th✓h✓h✓h by D✓D✓D✓Dh✓h✓h✓he✓e✓e✓ei✓i✓i✓ig✓g✓g✓gh✓h✓h✓ht✓t✓t✓t pixels.  If the window is too
  2694.       big to fit on the display, its  width  and  height  are  truncated.   The
  2695.       alternate  window's  _✓w_✓i_✓n_✓d_✓o_✓w-_✓i_✓d is returned if the window was created suc-
  2696.       cessfully.  The macro m_selectwin() is used to write on the newly created
  2697.       window.
  2698.  
  2699.  int
  2700.  m_setup( m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e)
  2701.  int mode;
  2702.  
  2703.  
  2704.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  2705.  
  2706.  
  2707.  
  2708.  
  2709.  
  2710.  MGR-C Language Application Interface- 39 -                       Functions
  2711.  
  2712.  
  2713.       This function initializes the library.  It  must  be  called  before  any
  2714.       other  function  or macro.  The argument m✓m✓m✓mo✓o✓o✓od✓d✓d✓de✓e✓e✓e is one or more of the flags
  2715.       _✓M__✓F_✓L_✓U_✓S_✓H, _✓M__✓D_✓E_✓B_✓U_✓G, or _✓M__✓M_✓O_✓D_✓E_✓O_✓K _✓o_✓r-ed together.  If _✓M__✓F_✓L_✓U_✓S_✓H is present, all
  2716.       macros  and  function flush output to MGR after each macro call.  This is
  2717.       slightly less efficient than letting the client program  flush  the  data
  2718.       (see m_flush() ) but prevent inadvertent buffering problems.  The _✓M__✓D_✓E_✓B_✓U_✓G
  2719.       flag forces the macro package to read and write  from  _✓s_✓t_✓d_✓i_✓n  and  _✓s_✓t_✓d_✓o_✓u_✓t
  2720.       respectively.   Normally  /_✓d_✓e_✓v/_✓t_✓t_✓y  is  opened for reading and writing to
  2721.       permit standard input or output redirection  while  still  maintaining  a
  2722.       connection  to  MGR.  If /_✓d_✓e_✓v/_✓t_✓t_✓y can not be opened, as would be the case
  2723.       for clients invoked through _✓r_✓s_✓h, the _✓M__✓D_✓E_✓B_✓U_✓G flag is turned on, and _✓s_✓t_✓d_✓i_✓n
  2724.       and _✓s_✓t_✓d_✓o_✓u_✓t are used instead.  The _✓M__✓M_✓O_✓D_✓E_✓O_✓K flag instructs those functions
  2725.       which expect data from MGR to assume the terminal modes are set appropri-
  2726.       ately.   Otherwise,  the  functions attempt to turn off character echoing
  2727.       and turn on line mode before  fetching  data  from  MGR.   The  functions
  2728.       m_ttyset()  and  m_ttyreset()  can  be used to set and reset the terminal
  2729.       modes.  The function m_setup() returns its  argument,  with  the  _✓M__✓D_✓E_✓B_✓U_✓G
  2730.       flag _✓o_✓r-ed in if /_✓d_✓e_✓v/_✓t_✓t_✓y can not be opened.
  2731.  
  2732.  void
  2733.  m_ttyreset()
  2734.  
  2735.       The terminal modes are restored to their state just  prior  to  the  last
  2736.       call  to m_ttyset().  Calls to m_ttyset() and m_ttyreset() may be stacked
  2737.       up to ten levels.
  2738.  
  2739.  int
  2740.  m_ttyset()
  2741.       The terminal is set in a state  suitable  for  data  exchange  with  MGR.
  2742.       Character  echoing  is  turned  off, and line processing mode is enabled.
  2743.       The function returns zero (0) if it successfully retrieves  the  terminal
  2744.       modes, -1 otherwise.
  2745.  
  2746.  
  2747.  
  2748.  
  2749.  
  2750.  
  2751.  
  2752.  
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.  
  2770.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  MGR-C Language Application Interface- 40 -                 Using the Library
  2777.  
  2778.  
  2779.  => _✓U_✓s_✓i_✓n_✓g _✓t_✓h_✓e _✓L_✓i_✓b_✓r_✓a_✓r_✓y
  2780.  
  2781.  Clients using _✓T_✓h_✓e _✓C _✓I_✓n_✓t_✓e_✓r_✓f_✓a_✓c_✓e _✓L_✓i_✓b_✓r_✓a_✓r_✓y should specify:
  2782.  
  2783.          #include "term.h"
  2784.  
  2785.  which also includes
  2786.  
  2787.          <stdio.h>
  2788.  
  2789.  if it has not already been included.  Programs are compiled either with
  2790.  
  2791.          cc -o foo foo.c term.o -I$(lib)
  2792.  
  2793.  where $(lib) is the MGR include directory or simply
  2794.  
  2795.          cc -o foo foo.c -lmgr
  2796.  
  2797.  if the library is installed in a standard location.  The file _✓t_✓e_✓r_✓m._✓o  contains
  2798.  the  functions  listed  in the last section.  Several compile time options are
  2799.  available to the client program using  the  library.   Normally,  the  library
  2800.  setup  routine,  m_setup()  attempts to open /_✓d_✓e_✓v/_✓t_✓t_✓y to communicate with MGR.
  2801.  Client  programs  may  define  the  C  preprocessor  symbols   _✓M__✓D_✓E_✓V_✓I_✓C_✓E_✓I_✓N   or
  2802.  _✓M__✓D_✓E_✓V_✓I_✓C_✓E_✓O_✓U_✓T  to override the selection of /_✓d_✓e_✓v/_✓t_✓t_✓y for input or output respec-
  2803.  tively.  After each macro call, the flush flag _✓M__✓F_✓L_✓U_✓S_✓H is  tested  to  see  if
  2804.  output  should  be  flushed to MGR.  If the C preprocessor symbol _✓M__✓N_✓O_✓F_✓L_✓U_✓S_✓H is
  2805.  defined, before the client program includes _✓t_✓e_✓r_✓m._✓h, The flush  flag  is  never
  2806.  tested, and it becomes the responsibility of the client program to insure out-
  2807.  put is flushed at the appropriate times.
  2808.  
  2809.  Several external variables maintained by the library are accessible to  client
  2810.  programs.  The _✓s_✓t_✓d_✓i_✓o _✓F_✓I_✓L_✓E pointers _✓m__✓t_✓e_✓r_✓m_✓i_✓n and _✓m__✓t_✓e_✓r_✓m_✓o_✓u_✓t are used for direct-
  2811.  ing output to, and receiving input from MGR.  These file pointers are initial-
  2812.  ized  in  m_setup(),  and may be changed by client programs after m_setup() is
  2813.  called.  The integer _✓m__✓f_✓l_✓a_✓g_✓s contains the current library  mode  settings,  as
  2814.  returned  by  m_setup().  The _✓M__✓M_✓O_✓D_✓E_✓O_✓K and _✓M__✓F_✓L_✓U_✓S_✓H bits of _✓m__✓f_✓l_✓a_✓g_✓s may also be
  2815.  changed at any time after m_setup() is called.  The  integer  _✓m__✓e_✓n_✓v_✓c_✓o_✓u_✓n_✓t  con-
  2816.  tains  the  current  window context depth, and is used by m_popall()to pop the
  2817.  appropriate number of contexts.  _✓M__✓e_✓n_✓v_✓c_✓o_✓u_✓n_✓t should not be  changed  by  client
  2818.  programs.   Finally, the character _✓m__✓m_✓e_✓n_✓u_✓c_✓h_✓a_✓r defines the menu separator char-
  2819.  acter used by menu_load().  This character, set to '\005' by the library pack-
  2820.  age,  can  be  changed to any character that will not appear as part of a menu
  2821.  item or action.
  2822.  
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835.  
  2836.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.  MGR-C Language Application Interface- 41 -                        Glossary
  2843.  
  2844.  
  2845.  => _✓G_✓l_✓o_✓s_✓s_✓a_✓r_✓y
  2846.  
  2847.  
  2848.  a✓a✓a✓ab✓b✓b✓bs✓s✓s✓so✓o✓o✓ol✓l✓l✓lu✓u✓u✓ut✓t✓t✓te✓e✓e✓e c✓c✓c✓co✓o✓o✓oo✓o✓o✓or✓r✓r✓rd✓d✓d✓di✓i✓i✓in✓n✓n✓na✓a✓a✓at✓t✓t✓te✓e✓e✓es✓s✓s✓s
  2849.       _✓A_✓b_✓s_✓o_✓l_✓u_✓t_✓e _✓c_✓o_✓o_✓r_✓d_✓i_✓n_✓a_✓t_✓e_✓s is a coordinate system used in _✓w_✓i_✓n_✓d_✓o_✓w_✓s  measured  in
  2850.       units of pixels.
  2851.  
  2852.  a✓a✓a✓ac✓c✓c✓ct✓t✓t✓ti✓i✓i✓iv✓v✓v✓ve✓e✓e✓e w✓w✓w✓wi✓i✓i✓in✓n✓n✓nd✓d✓d✓do✓o✓o✓ow✓w✓w✓w
  2853.       The _✓a_✓c_✓t_✓i_✓v_✓e window is the window logically in the front  of  the  display,
  2854.       which is receiving keyboard and mouse input.
  2855.  
  2856.  a✓a✓a✓al✓l✓l✓lt✓t✓t✓te✓e✓e✓er✓r✓r✓rn✓n✓n✓na✓a✓a✓at✓t✓t✓te✓e✓e✓e w✓w✓w✓wi✓i✓i✓in✓n✓n✓nd✓d✓d✓do✓o✓o✓ow✓w✓w✓w
  2857.       An _✓a_✓l_✓t_✓e_✓r_✓n_✓a_✓t_✓e _✓w_✓i_✓n_✓d_✓o_✓w is an additional window created by a  client  program
  2858.       that shares the communication channel with the main window.
  2859.  
  2860.  b✓b✓b✓bi✓i✓i✓it✓t✓t✓tm✓m✓m✓ma✓a✓a✓ap✓p✓p✓p
  2861.       A _✓b_✓i_✓t_✓m_✓a_✓p is a rectangular array of bits,  or  pixels  if  the  bitmap  is
  2862.       currently on the display.
  2863.  
  2864.  c✓c✓c✓ch✓h✓h✓ha✓a✓a✓an✓n✓n✓nn✓n✓n✓ne✓e✓e✓el✓l✓l✓l
  2865.       The _✓c_✓h_✓a_✓n_✓n_✓e_✓l is the bidirectional byte  stream  connecting  MGR  with  the
  2866.       client  program.  The _✓c_✓h_✓a_✓n_✓n_✓e_✓l is usually the program's standard input and
  2867.       output.
  2868.  
  2869.  c✓c✓c✓ch✓h✓h✓ha✓a✓a✓ar✓r✓r✓ra✓a✓a✓ac✓c✓c✓ct✓t✓t✓te✓e✓e✓er✓r✓r✓r c✓c✓c✓co✓o✓o✓oo✓o✓o✓or✓r✓r✓rd✓d✓d✓di✓i✓i✓in✓n✓n✓na✓a✓a✓at✓t✓t✓te✓e✓e✓es✓s✓s✓s
  2870.       _✓C_✓h_✓a_✓r_✓a_✓c_✓t_✓e_✓r _✓c_✓o_✓o_✓r_✓d_✓i_✓n_✓a_✓t_✓e_✓s is the coordinate system used in windows for count-
  2871.       ing characters in _✓c_✓o_✓l_✓u_✓m_✓n_✓s and _✓r_✓o_✓w_✓s.
  2872.  
  2873.  c✓c✓c✓ch✓h✓h✓ha✓a✓a✓ar✓r✓r✓ra✓a✓a✓ac✓c✓c✓ct✓t✓t✓te✓e✓e✓er✓r✓r✓r c✓c✓c✓cu✓u✓u✓ur✓r✓r✓rs✓s✓s✓so✓o✓o✓or✓r✓r✓r
  2874.       The _✓c_✓h_✓a_✓r_✓a_✓c_✓t_✓e_✓r _✓c_✓u_✓r_✓s_✓o_✓r is the location in the window where the next charac-
  2875.       ter  will  be  placed.   The cursor location is always highlighted on the
  2876.       active window.
  2877.  
  2878.  c✓c✓c✓ch✓h✓h✓hi✓i✓i✓il✓l✓l✓ld✓d✓d✓d m✓m✓m✓me✓e✓e✓en✓n✓n✓nu✓u✓u✓u
  2879.       A _✓c_✓h_✓i_✓l_✓d _✓m_✓e_✓n_✓u is the menu that will pop up when the user slides off to the
  2880.       right of a popped up _✓p_✓a_✓r_✓e_✓n_✓t _✓m_✓e_✓n_✓u.
  2881.  
  2882.  c✓c✓c✓cl✓l✓l✓li✓i✓i✓ie✓e✓e✓en✓n✓n✓nt✓t✓t✓t p✓p✓p✓pr✓r✓r✓ro✓o✓o✓og✓g✓g✓gr✓r✓r✓ra✓a✓a✓am✓m✓m✓m
  2883.       A _✓c_✓l_✓i_✓e_✓n_✓t _✓p_✓r_✓o_✓g_✓r_✓a_✓m is any Unix command that is running in  an  MGR  window.
  2884.       Client  programs  may  be existing programs, as might be found in /_✓b_✓i_✓n or
  2885.       new applications written specifically to take advantage of the  windowing
  2886.       environment.
  2887.  
  2888.  c✓c✓c✓cl✓l✓l✓li✓i✓i✓ie✓e✓e✓en✓n✓n✓nt✓t✓t✓t-✓-✓-✓-h✓h✓h✓ho✓o✓o✓os✓s✓s✓st✓t✓t✓t
  2889.       The _✓c_✓l_✓i_✓e_✓n_✓t-_✓h_✓o_✓s_✓t is the computer that the client program  is  running  on.
  2890.       It is often the same as the _✓M_✓G_✓R-_✓h_✓o_✓s_✓t machine, but it does not need to be.
  2891.  
  2892.  d✓d✓d✓di✓i✓i✓is✓s✓s✓sp✓p✓p✓pl✓l✓l✓la✓a✓a✓ay✓y✓y✓y c✓c✓c✓co✓o✓o✓oo✓o✓o✓or✓r✓r✓rd✓d✓d✓di✓i✓i✓in✓n✓n✓na✓a✓a✓at✓t✓t✓te✓e✓e✓es✓s✓s✓s
  2893.       _✓D_✓i_✓s_✓p_✓l_✓a_✓y _✓c_✓o_✓o_✓r_✓d_✓i_✓n_✓a_✓t_✓e_✓s is a coordinate system used to measure pixels on  the
  2894.       display.  The top left corner of the display is at (0,0), with _✓x increas-
  2895.       ing to the right, and _✓y increasing down.
  2896.  
  2897.  e✓e✓e✓ex✓x✓x✓xp✓p✓p✓po✓o✓o✓os✓s✓s✓se✓e✓e✓ed✓d✓d✓d
  2898.       A window is _✓e_✓x_✓p_✓o_✓s_✓e_✓d if it is entirely visible.
  2899.  
  2900.  
  2901.  
  2902.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908.  MGR-C Language Application Interface- 42 -                        Glossary
  2909.  
  2910.  
  2911.  g✓g✓g✓gr✓r✓r✓ra✓a✓a✓ap✓p✓p✓ph✓h✓h✓hi✓i✓i✓ic✓c✓c✓cs✓s✓s✓s p✓p✓p✓po✓o✓o✓oi✓i✓i✓in✓n✓n✓nt✓t✓t✓t
  2912.       The _✓g_✓r_✓a_✓p_✓h_✓i_✓c_✓s _✓p_✓o_✓i_✓n_✓t is a location on the window, measured in the  prevail-
  2913.       ing  window  coordinate system, that may serve as a reference location or
  2914.       origin for many of the graphics operations.
  2915.  
  2916.  l✓l✓l✓li✓i✓i✓is✓s✓s✓st✓t✓t✓te✓e✓e✓en✓n✓n✓ne✓e✓e✓er✓r✓r✓r
  2917.       A _✓l_✓i_✓s_✓t_✓e_✓n_✓e_✓r is a window that has turned on the A✓A✓A✓AC✓C✓C✓CC✓C✓C✓CE✓E✓E✓EP✓P✓P✓PT✓T✓T✓T event and is willing
  2918.       to receive messages from other client programs.
  2919.  
  2920.  m✓m✓m✓ma✓a✓a✓ai✓i✓i✓in✓n✓n✓n w✓w✓w✓wi✓i✓i✓in✓n✓n✓nd✓d✓d✓do✓o✓o✓ow✓w✓w✓w
  2921.       A client program's _✓m_✓a_✓i_✓n _✓w_✓i_✓n_✓d_✓o_✓w is the window the program was started  in.
  2922.       The  client program may create and destroy alternate windows, but not its
  2923.       _✓m_✓a_✓i_✓n _✓w_✓i_✓n_✓d_✓o_✓w.  If the user destroys a client program's  _✓m_✓a_✓i_✓n  _✓w_✓i_✓n_✓d_✓o_✓w,  the
  2924.       connection  to  MGR  is severed, and the client program receives a _✓h_✓a_✓n_✓g_✓u_✓p
  2925.       signal.
  2926.  
  2927.  M✓M✓M✓MG✓G✓G✓GR✓R✓R✓R-✓-✓-✓-h✓h✓h✓ho✓o✓o✓os✓s✓s✓st✓t✓t✓t
  2928.       The MGR-host is the computer that MGR is running on.
  2929.  
  2930.  m✓m✓m✓mo✓o✓o✓ou✓u✓u✓us✓s✓s✓se✓e✓e✓e c✓c✓c✓cu✓u✓u✓ur✓r✓r✓rs✓s✓s✓so✓o✓o✓or✓r✓r✓r
  2931.       The _✓m_✓o_✓u_✓s_✓e _✓c_✓u_✓r_✓s_✓o_✓r is a small bitmap or _✓i_✓c_✓o_✓n that tracks  the  movement  of
  2932.       the  mouse  on  the  display.  Normally the _✓m_✓o_✓u_✓s_✓e _✓c_✓u_✓r_✓s_✓o_✓r is a small arrow
  2933.       pointing north west.
  2934.  
  2935.  o✓o✓o✓ob✓b✓b✓bs✓s✓s✓sc✓c✓c✓cu✓u✓u✓ur✓r✓r✓re✓e✓e✓ed✓d✓d✓d
  2936.       A window is _✓o_✓b_✓s_✓c_✓u_✓r_✓e_✓d when it is partially or totally covered  by  another
  2937.       window.
  2938.  
  2939.  p✓p✓p✓pa✓a✓a✓ar✓r✓r✓re✓e✓e✓en✓n✓n✓nt✓t✓t✓t m✓m✓m✓me✓e✓e✓en✓n✓n✓nu✓u✓u✓u
  2940.       A  menu is called a _✓p_✓a_✓r_✓e_✓n_✓t _✓m_✓e_✓n_✓u when  sliding  off  to  the  right  of  a
  2941.       selected item causes another menu or _✓c_✓h_✓i_✓l_✓d _✓m_✓e_✓n_✓u to pop up.
  2942.  
  2943.  r✓r✓r✓re✓e✓e✓el✓l✓l✓la✓a✓a✓at✓t✓t✓ti✓i✓i✓iv✓v✓v✓ve✓e✓e✓e c✓c✓c✓co✓o✓o✓oo✓o✓o✓or✓r✓r✓rd✓d✓d✓di✓i✓i✓in✓n✓n✓na✓a✓a✓at✓t✓t✓te✓e✓e✓es✓s✓s✓s
  2944.       _✓R_✓e_✓l_✓a_✓t_✓i_✓v_✓e _✓c_✓o_✓o_✓r_✓d_✓i_✓n_✓a_✓t_✓e_✓s is a coordinate system for windows  where  a  single
  2945.       unit represents one thousandth of the way across (or down) the window.
  2946.  
  2947.  s✓s✓s✓sc✓c✓c✓cr✓r✓r✓ra✓a✓a✓at✓t✓t✓tc✓c✓c✓ch✓h✓h✓hp✓p✓p✓pa✓a✓a✓ad✓d✓d✓d b✓b✓b✓bi✓i✓i✓it✓t✓t✓tm✓m✓m✓ma✓a✓a✓ap✓p✓p✓p
  2948.       A _✓s_✓c_✓r_✓a_✓t_✓c_✓h_✓p_✓a_✓d _✓b_✓i_✓t_✓m_✓a_✓p is a chunk of memory, allocated by MGR for use  by  a
  2949.       client program, that may hold a bitmap image that is not on the display.
  2950.  
  2951.  s✓s✓s✓sn✓n✓n✓na✓a✓a✓ar✓r✓r✓rf✓f✓f✓f b✓b✓b✓bu✓u✓u✓uf✓f✓f✓ff✓f✓f✓fe✓e✓e✓er✓r✓r✓r
  2952.       The _✓s_✓n_✓a_✓r_✓f _✓b_✓u_✓f_✓f_✓e_✓r is a buffer maintained by MGR of arbitrary size that  is
  2953.       accessible by all client programs.
  2954.  
  2955.  t✓t✓t✓ta✓a✓a✓ar✓r✓r✓rg✓g✓g✓ge✓e✓e✓et✓t✓t✓t w✓w✓w✓wi✓i✓i✓in✓n✓n✓nd✓d✓d✓do✓o✓o✓ow✓w✓w✓w
  2956.       A _✓t_✓a_✓r_✓g_✓e_✓t _✓w_✓i_✓n_✓d_✓o_✓w is a window that is to receive  a  message  from  another
  2957.       window.
  2958.  
  2959.  t✓t✓t✓te✓e✓e✓ex✓x✓x✓xt✓t✓t✓t r✓r✓r✓re✓e✓e✓eg✓g✓g✓gi✓i✓i✓io✓o✓o✓on✓n✓n✓n
  2960.       A _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n is the part of the window in which character text  and  the
  2961.       functions  that  operate  on characters work.  The _✓t_✓e_✓x_✓t _✓r_✓e_✓g_✓i_✓o_✓n may be the
  2962.       entire window (the default) or a rectangular subregion within the window.
  2963.  
  2964.  w✓w✓w✓wi✓i✓i✓in✓n✓n✓nd✓d✓d✓do✓o✓o✓ow✓w✓w✓w b✓b✓b✓bo✓o✓o✓or✓r✓r✓rd✓d✓d✓de✓e✓e✓er✓r✓r✓r
  2965.  
  2966.  
  2967.  
  2968.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  2969.  
  2970.  
  2971.  
  2972.  
  2973.  
  2974.  MGR-C Language Application Interface- 43 -                        Glossary
  2975.  
  2976.  
  2977.       The _✓w_✓i_✓n_✓d_✓o_✓w _✓b_✓o_✓r_✓d_✓e_✓r is  a  thin  black  border  around  every  window  that
  2978.       separates the window from the rest of the display.
  2979.  
  2980.  w✓w✓w✓wi✓i✓i✓in✓n✓n✓nd✓d✓d✓do✓o✓o✓ow✓w✓w✓w c✓c✓c✓co✓o✓o✓on✓n✓n✓nt✓t✓t✓te✓e✓e✓ex✓x✓x✓xt✓t✓t✓t
  2981.       A _✓w_✓i_✓n_✓d_✓o_✓w _✓c_✓o_✓n_✓t_✓e_✓x_✓t contains the values for  one  or  more  aspects  of  the
  2982.       window's  state.   _✓W_✓i_✓n_✓d_✓o_✓w  _✓c_✓o_✓n_✓t_✓e_✓x_✓t  a  may  be saved on a stack, and then
  2983.       restored at some later time.
  2984.  
  2985.  w✓w✓w✓wi✓i✓i✓in✓n✓n✓nd✓d✓d✓do✓o✓o✓ow✓w✓w✓w i✓i✓i✓id✓d✓d✓d
  2986.       A _✓w_✓i_✓n_✓d_✓o_✓w _✓i_✓d is a unique number assigned to every window that may be  used
  2987.       as  an  identifier when sending a message to the window.  _✓W_✓i_✓n_✓d_✓o_✓w _✓i_✓ds have
  2988.       two parts, the first part is the process number  of  the  client  program
  2989.       that was started when the window was created, the second part is the win-
  2990.       dows _✓a_✓l_✓t_✓e_✓r_✓n_✓a_✓t_✓e window number, or zero for a main window.
  2991.  
  2992.  
  2993.  
  2994.  
  2995.  
  2996.  
  2997.  
  2998.  
  2999.  
  3000.  
  3001.  
  3002.  
  3003.  
  3004.  
  3005.  
  3006.  
  3007.  
  3008.  
  3009.  
  3010.  
  3011.  
  3012.  
  3013.  
  3014.  
  3015.  
  3016.  
  3017.  
  3018.  
  3019.  
  3020.  
  3021.  
  3022.  
  3023.  
  3024.  
  3025.  
  3026.  
  3027.  
  3028.  
  3029.  
  3030.  
  3031.  
  3032.  
  3033.  
  3034.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  3035.  
  3036.  
  3037.  
  3038.  
  3039.  
  3040.  MGR-C Language Application Interface- 44 -             Sample Client Program
  3041.  
  3042.  
  3043.  => _✓S_✓a_✓m_✓p_✓l_✓e _✓C_✓l_✓i_✓e_✓n_✓t _✓P_✓r_✓o_✓g_✓r_✓a_✓m
  3044.  
  3045.  
  3046.  This program, called _✓c_✓l_✓o_✓s_✓e, closes, or iconifies a window. Its not a  terribly
  3047.  useful  application  in  its  own  right,  but it does exercise several of the
  3048.  library calls.  When _✓c_✓l_✓o_✓s_✓e starts up, it makes the window  smaller,  moves  it
  3049.  toward  the  top  of the display, then writes the word "closed" in it.  If the
  3050.  window is covered by another window, it changes the word "closed" to "hidden",
  3051.  then flashes its window every 15 seconds as long as the window is covered.  If
  3052.  the window is then uncovered, the word "hidden" gets changed back to "closed".
  3053.  Activating  the window causes _✓c_✓l_✓o_✓s_✓e to restore the window's original shape and
  3054.  contents, then exit.
  3055.  
  3056.  /* _✓i_✓c_✓o_✓n_✓i_✓f_✓y _✓a _✓M_✓G_✓R _✓w_✓i_✓n_✓d_✓o_✓w */
  3057.  
  3058.  #include <signal.h>
  3059.  #include "term.h"
  3060.  
  3061.  #define TIME    15                /* _✓t_✓i_✓m_✓e _✓i_✓n_✓t_✓e_✓r_✓v_✓a_✓l _✓f_✓o_✓r _✓r_✓e_✓m_✓i_✓n_✓d_✓e_✓r */
  3062.  #define CONTEXT P_POSITION | P_WINDOW | P_FLAGS | P_EVENT | P_CURSOR
  3063.  
  3064.  static char line[80];             /* _✓e_✓v_✓e_✓n_✓t _✓i_✓n_✓p_✓u_✓t _✓b_✓u_✓f_✓f_✓e_✓r */
  3065.  
  3066.  main()
  3067.      {
  3068.      int clean(), timer();         /* _✓i_✓n_✓t_✓e_✓r_✓r_✓u_✓p_✓t _✓r_✓o_✓u_✓t_✓i_✓n_✓e_✓s */
  3069.      int x,y;                      /* _✓w_✓i_✓n_✓d_✓o_✓w _✓p_✓o_✓s_✓i_✓t_✓i_✓o_✓n _✓o_✓n _✓d_✓i_✓s_✓p_✓l_✓a_✓y */
  3070.      char *msg = "closed";         /* _✓c_✓l_✓o_✓s_✓e_✓d _✓w_✓i_✓n_✓d_✓o_✓w "_✓i_✓c_✓o_✓n" */
  3071.  
  3072.      /* _✓s_✓e_✓t_✓u_✓p _✓t_✓h_✓e _✓w_✓i_✓n_✓d_✓o_✓w _✓e_✓n_✓v_✓i_✓r_✓o_✓n_✓m_✓e_✓n_✓t */
  3073.  
  3074.      m_setup(M_FLUSH);             /* _✓s_✓e_✓t_✓u_✓p _✓i/_✓o, _✓t_✓u_✓r_✓n _✓o_✓n _✓f_✓l_✓u_✓s_✓h_✓i_✓n_✓g */
  3075.      m_push(CONTEXT);              /* _✓s_✓a_✓v_✓e _✓c_✓u_✓r_✓r_✓e_✓n_✓t _✓w_✓i_✓n_✓d_✓o_✓w _✓c_✓o_✓n_✓t_✓e_✓x_✓t */
  3076.      m_setmode(M_NOWRAP);          /* _✓d_✓o_✓n'_✓t _✓a_✓u_✓t_✓o-_✓w_✓r_✓a_✓p _✓a_✓t _✓r_✓i_✓g_✓h_✓t _✓m_✓a_✓r_✓g_✓i_✓n */
  3077.      m_ttyset();                   /* _✓s_✓e_✓t _✓u_✓p _✓t_✓t_✓y _✓m_✓o_✓d_✓e_✓s */
  3078.  
  3079.      /* _✓c_✓a_✓t_✓c_✓h _✓t_✓h_✓e _✓a_✓p_✓p_✓r_✓o_✓p_✓r_✓i_✓a_✓t_✓e _✓s_✓i_✓g_✓n_✓a_✓l_✓s */
  3080.  
  3081.      signal(SIGTERM,clean);        /* _✓i_✓n _✓c_✓a_✓s_✓e _✓w_✓e _✓g_✓e_✓t _✓t_✓e_✓r_✓m_✓i_✓n_✓a_✓t_✓e_✓d */
  3082.      signal(SIGALRM,timer);        /* _✓f_✓o_✓r _✓t_✓h_✓e _✓r_✓e_✓m_✓i_✓n_✓d_✓e_✓r _✓s_✓e_✓r_✓v_✓i_✓c_✓e */
  3083.  
  3084.      /* _✓i_✓c_✓o_✓n_✓i_✓f_✓y _✓t_✓h_✓e _✓w_✓i_✓n_✓d_✓o_✓w */
  3085.  
  3086.      get_size(&x,&y,0,0);          /* _✓f_✓e_✓t_✓c_✓h _✓w_✓i_✓n_✓d_✓o_✓w _✓c_✓o_✓o_✓r_✓d_✓i_✓n_✓a_✓t_✓e_✓s */
  3087.      m_sizeall(x,10,strlen(msg),1);/* _✓m_✓o_✓v_✓e _✓a_✓n_✓d _✓r_✓e_✓s_✓i_✓z_✓e _✓w_✓i_✓n_✓d_✓o_✓w */
  3088.      m_clear();                    /* _✓c_✓l_✓e_✓a_✓r _✓t_✓h_✓e _✓w_✓i_✓n_✓d_✓o_✓w */
  3089.      m_printstr(msg);              /* _✓p_✓r_✓i_✓n_✓t _✓m_✓e_✓s_✓s_✓a_✓g_✓e _✓i_✓n _✓t_✓h_✓e _✓w_✓i_✓n_✓d_✓o_✓w */
  3090.  
  3091.      /* _✓c_✓a_✓t_✓c_✓h _✓e_✓v_✓e_✓n_✓t_✓s */
  3092.  
  3093.      m_setevent(ACTIVATE, "A\r"); /* _✓w_✓i_✓n_✓d_✓o_✓w _✓i_✓s _✓n_✓o_✓w _✓t_✓h_✓e _✓a_✓c_✓t_✓i_✓v_✓e _✓w_✓i_✓n_✓d_✓o_✓w */
  3094.      m_setevent(COVERED,  "C\r"); /* _✓c_✓o_✓v_✓e_✓r_✓e_✓d _✓b_✓y _✓a_✓n_✓o_✓t_✓h_✓e_✓r _✓w_✓i_✓n_✓d_✓o_✓w */
  3095.      m_setevent(UNCOVERED,"U\r"); /* _✓c_✓o_✓m_✓p_✓l_✓e_✓t_✓e_✓l_✓y _✓v_✓i_✓s_✓i_✓b_✓l_✓e */
  3096.      m_setevent(REDRAW,   "R\r"); /* _✓r_✓e_✓d_✓r_✓a_✓w _✓r_✓e_✓q_✓u_✓e_✓s_✓t_✓e_✓d */
  3097.  
  3098.  
  3099.  
  3100.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  3101.  
  3102.  
  3103.  
  3104.  
  3105.  
  3106.  MGR-C Language Application Interface- 45 -             Sample Client Program
  3107.  
  3108.  
  3109.      m_clearmode(M_ACTIVATE);      /* _✓b_✓u_✓r_✓y _✓t_✓h_✓e _✓w_✓i_✓n_✓d_✓o_✓w */
  3110.  
  3111.      /* _✓w_✓a_✓i_✓t _✓f_✓o_✓r _✓a_✓n _✓e_✓v_✓e_✓n_✓t */
  3112.  
  3113.      while(m_gets(line) != NULL)   /* _✓r_✓e_✓a_✓d _✓a _✓l_✓i_✓n_✓e _✓f_✓r_✓o_✓m _✓M_✓G_✓R */
  3114.          switch (*line) {
  3115.          case 'A':                 /* _✓w_✓i_✓n_✓d_✓o_✓w _✓i_✓s _✓a_✓c_✓t_✓i_✓v_✓a_✓t_✓e_✓d */
  3116.              clean();              /* _✓c_✓l_✓e_✓a_✓n _✓u_✓p _✓a_✓n_✓d _✓e_✓x_✓i_✓t */
  3117.              break;
  3118.          case 'C':                 /* _✓w_✓i_✓n_✓d_✓o_✓w _✓i_✓s _✓c_✓o_✓v_✓e_✓r_✓e_✓d */
  3119.              m_clear();
  3120.              m_printstr("hidden");
  3121.              alarm(TIME);          /* _✓t_✓u_✓r_✓n _✓o_✓n _✓r_✓e_✓m_✓i_✓n_✓d_✓e_✓r */
  3122.              break;
  3123.          case 'R':                 /* _✓s_✓y_✓s_✓t_✓e_✓m '_✓r_✓e_✓d_✓r_✓a_✓w' */
  3124.          case 'U':                 /* _✓w_✓i_✓n_✓d_✓o_✓w _✓i_✓s _✓u_✓n_✓c_✓o_✓v_✓e_✓r_✓e_✓d */
  3125.              m_clear();
  3126.              m_printstr(msg);
  3127.              alarm(0);             /* _✓t_✓u_✓r_✓n _✓o_✓f_✓f _✓r_✓e_✓m_✓i_✓n_✓d_✓e_✓r */
  3128.              break;
  3129.          case 'T':                 /* _✓s_✓e_✓n_✓d _✓r_✓e_✓m_✓i_✓n_✓d_✓e_✓r */
  3130.              m_setmode(M_WOB);     /* _✓h_✓i_✓g_✓h_✓l_✓i_✓g_✓h_✓t _✓w_✓i_✓n_✓d_✓o_✓w */
  3131.              m_bell();             /* _✓r_✓i_✓n_✓g _✓t_✓h_✓e _✓b_✓e_✓l_✓l */
  3132.              sleep(1);
  3133.              alarm(TIME);          /* _✓r_✓e_✓s_✓e_✓t _✓r_✓e_✓m_✓i_✓n_✓d_✓e_✓r _✓t_✓i_✓m_✓e_✓r */
  3134.              m_clearmode(M_WOB);   /* _✓r_✓e_✓s_✓e_✓t _✓w_✓i_✓n_✓d_✓o_✓w _✓h_✓i_✓g_✓h_✓l_✓i_✓g_✓h_✓t_✓i_✓n_✓g */
  3135.              break;
  3136.          }
  3137.      }
  3138.  
  3139.  clean()                           /* _✓c_✓l_✓e_✓a_✓n _✓u_✓p _✓a_✓n_✓d _✓e_✓x_✓i_✓t */
  3140.      {
  3141.      m_ttyreset();                 /* _✓r_✓e_✓s_✓e_✓t _✓t_✓t_✓y _✓m_✓o_✓d_✓e_✓s */
  3142.      m_popall();                   /* _✓r_✓e_✓s_✓t_✓o_✓r_✓e _✓w_✓i_✓n_✓d_✓o_✓w _✓c_✓o_✓n_✓t_✓e_✓x_✓t */
  3143.      exit(0);
  3144.      }
  3145.  
  3146.  timer()                           /* _✓c_✓a_✓l_✓l_✓e_✓d _✓a_✓t _✓r_✓e_✓m_✓i_✓n_✓d_✓e_✓r _✓t_✓i_✓m_✓e_✓o_✓u_✓t */
  3147.      {
  3148.      m_sendme("T\r");             /* _✓s_✓e_✓n_✓d _✓t_✓i_✓m_✓e_✓o_✓u_✓t _✓m_✓e_✓s_✓s_✓a_✓g_✓e */
  3149.      }
  3150.  
  3151.  
  3152.  
  3153.  
  3154.  
  3155.  
  3156.  
  3157.  
  3158.  
  3159.  
  3160.  
  3161.  
  3162.  
  3163.  
  3164.  
  3165.  
  3166.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  3167.  
  3168.  
  3169.  
  3170.  
  3171.  
  3172.  MGR-C Language Application Interface- 46 -    Macros and Functions by Category
  3173.  
  3174.  
  3175.  => _✓M_✓a_✓c_✓r_✓o_✓s _✓a_✓n_✓d _✓F_✓u_✓n_✓c_✓t_✓i_✓o_✓n_✓s _✓b_✓y _✓C_✓a_✓t_✓e_✓g_✓o_✓r_✓y
  3176.  
  3177.  
  3178.  
  3179.  
  3180.  _✓L_✓i_✓b_✓r_✓a_✓r_✓y _✓P_✓a_✓c_✓k_✓a_✓g_✓e _✓C_✓o_✓n_✓t_✓r_✓o_✓l*
  3181.  
  3182.  
  3183.  
  3184.  m_bell 9✓9✓9✓9............Flash the window and ring the bell.
  3185.  
  3186.  m_flush 1✓1✓1✓13✓3✓3✓3..........Flush any outpout pending for the window.
  3187.  
  3188.  m_lastline|✓- 3✓3✓3✓31✓1✓1✓1......Retrieve the last line send from MGR for a  library  func-
  3189.                      tion.
  3190.  
  3191.  m_resetesc 2✓2✓2✓21✓1✓1✓1.......Restore the MGR escape character to '033'.
  3192.  
  3193.  m_setecho 2✓2✓2✓22✓2✓2✓2........Turn on terminal character echo.
  3194.  
  3195.  m_setesc 2✓2✓2✓22✓2✓2✓2.........Change the MGR escape character (for debugging).
  3196.  
  3197.  m_setnoecho 2✓2✓2✓26✓6✓6✓6......Turn off character echo.
  3198.  
  3199.  m_setnoraw 2✓2✓2✓26✓6✓6✓6.......Enable normal character input processing (line mode).
  3200.  
  3201.  m_setraw 2✓2✓2✓26✓6✓6✓6.........Disable all character input processing (raw mode).
  3202.  
  3203.  m_setup|✓- 3✓3✓3✓31✓1✓1✓1.........Initialize the library package.
  3204.  
  3205.  m_ttyreset|✓- 3✓3✓3✓32✓2✓2✓2......Reset the tty modes.
  3206.  
  3207.  m_ttyset|✓- 3✓3✓3✓32✓2✓2✓2........Set the tty modes for proper MGR interaction.
  3208.  
  3209.  
  3210.  _✓S_✓t_✓a_✓n_✓d_✓a_✓r_✓d _✓I/_✓O _✓F_✓u_✓n_✓c_✓t_✓i_✓o_✓n_✓s
  3211.  
  3212.  
  3213.  
  3214.  m_getchar 1✓1✓1✓14✓4✓4✓4........Read a character from MGR.
  3215.  
  3216.  m_gets 1✓1✓1✓14✓4✓4✓4...........Read a line from MGR.
  3217.  
  3218.  m_printstr 1✓1✓1✓19✓9✓9✓9.......Print a string on the window.
  3219.  
  3220.  m_putchar 2✓2✓2✓21✓1✓1✓1........Put a character on the window.
  3221.  
  3222.  
  3223.  _________________________
  3224.    * The  routines  marked  with  a   dagger   (|✓-)   are
  3225.  functions,  the  other  routines  are macros.  The page
  3226.  number on which the macro or  function  is  defined  is
  3227.  printed in bold face after the name.
  3228.  
  3229.  
  3230.  
  3231.  
  3232.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  3233.  
  3234.  
  3235.  
  3236.  
  3237.  
  3238.  MGR-C Language Application Interface- 47 -    Macros and Functions by Category
  3239.  
  3240.  
  3241.  _✓T_✓e_✓r_✓m_✓i_✓n_✓a_✓l _✓F_✓u_✓n_✓c_✓t_✓i_✓o_✓n_✓s
  3242.  
  3243.  
  3244.  
  3245.  m_addchar 9✓9✓9✓9.........Insert a space character.
  3246.  
  3247.  m_addchars 9✓9✓9✓9........Insert some space characters.
  3248.  
  3249.  m_addline 9✓9✓9✓9.........Insert a blank line.
  3250.  
  3251.  m_addlines 9✓9✓9✓9........Insert some blank lines.
  3252.  
  3253.  m_clear 1✓1✓1✓11✓1✓1✓1..........Clear the window.
  3254.  
  3255.  m_cleareol 1✓1✓1✓11✓1✓1✓1.......Clear to the end of the line.
  3256.  
  3257.  m_cleareos 1✓1✓1✓11✓1✓1✓1.......Clear to the end of the window.
  3258.  
  3259.  m_deletechar 1✓1✓1✓12✓2✓2✓2.....Delete a character.
  3260.  
  3261.  m_deletechars 1✓1✓1✓12✓2✓2✓2....Delete characters.
  3262.  
  3263.  m_deleteline 1✓1✓1✓12✓2✓2✓2.....Delete a line.
  3264.  
  3265.  m_deletelines 1✓1✓1✓12✓2✓2✓2....Delete lines.
  3266.  
  3267.  m_move 1✓1✓1✓18✓8✓8✓8...........Move the character cursor.
  3268.  
  3269.  m_scrollregion 2✓2✓2✓22✓2✓2✓2...Set up a VT00 like scrolling region.
  3270.  
  3271.  m_standend 2✓2✓2✓27✓7✓7✓7.......Turn off reverse video characters.
  3272.  
  3273.  m_standout 2✓2✓2✓27✓7✓7✓7.......Turn on reverse video characters.
  3274.  
  3275.  m_textreset 2✓2✓2✓27✓7✓7✓7......Reset the text region to the entire window.
  3276.  
  3277.  
  3278.  _✓G_✓r_✓a_✓p_✓h_✓i_✓c_✓s _✓P_✓r_✓i_✓m_✓i_✓t_✓i_✓v_✓e_✓s
  3279.  
  3280.  
  3281.  
  3282.  m_arc 9✓9✓9✓9.............Draw an arc.
  3283.  
  3284.  m_circle 1✓1✓1✓11✓1✓1✓1.........Draw a circle.
  3285.  
  3286.  m_draw 1✓1✓1✓13✓3✓3✓3...........Draw a line from the graphics point.
  3287.  
  3288.  m_ellipse 1✓1✓1✓13✓3✓3✓3........Draw an ellipse.
  3289.  
  3290.  m_ellipseto 1✓1✓1✓13✓3✓3✓3......Draw an ellipse on a scratchpad bitmap.
  3291.  
  3292.  m_fastdraw 1✓1✓1✓13✓3✓3✓3.......Draw a group of fast vectors.
  3293.  
  3294.  m_func 1✓1✓1✓13✓3✓3✓3...........Set the bit-blt and graphics drawing mode.
  3295.  
  3296.  
  3297.  
  3298.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304.  MGR-C Language Application Interface- 48 -    Macros and Functions by Category
  3305.  
  3306.  
  3307.  m_go 1✓1✓1✓17✓7✓7✓7.............Move the graphics point.
  3308.  
  3309.  m_gotext 1✓1✓1✓17✓7✓7✓7.........Align the graphics point with the character cursor.
  3310.  
  3311.  m_line 1✓1✓1✓17✓7✓7✓7...........Draw a line.
  3312.  
  3313.  m_lineto 1✓1✓1✓17✓7✓7✓7.........Draw a line on a scratchpad bitmap.
  3314.  
  3315.  m_rcircle 2✓2✓2✓21✓1✓1✓1........Draw a circle at the graphics point.
  3316.  
  3317.  m_rellipse 2✓2✓2✓21✓1✓1✓1.......Draw an ellipse at the graphics point.
  3318.  
  3319.  m_rfastdraw 2✓2✓2✓21✓1✓1✓1......Draw a group of fast vectors at the graphics point.
  3320.  
  3321.  m_stringto 2✓2✓2✓27✓7✓7✓7.......Print a string to an scratchpad bitmap.
  3322.  
  3323.  
  3324.  _✓B_✓i_✓t-_✓b_✓l_✓t_✓s _✓a_✓n_✓d _✓R_✓e_✓l_✓a_✓t_✓e_✓d _✓F_✓u_✓n_✓c_✓t_✓i_✓o_✓n_✓s
  3325.  
  3326.  
  3327.  
  3328.  m_bitcopy 9✓9✓9✓9.........Bit-blt a rectangle within the window.
  3329.  
  3330.  m_bitcopyto 9✓9✓9✓9.......Bit-blt a rectangle between two bitmaps.
  3331.  
  3332.  m_bitcreate 9✓9✓9✓9.......Create a scratchpad bitmap.
  3333.  
  3334.  m_bitdestroy 1✓1✓1✓10✓0✓0✓0.....Destroy a scratchpad bitmap.
  3335.  
  3336.  m_bitfile|✓- 3✓3✓3✓31✓1✓1✓1.......Read a bitmap file into a scratchpad bitmap.
  3337.  
  3338.  m_bitfromfile 1✓1✓1✓10✓0✓0✓0....Read a bitmap file into a scratchpad bitmap.
  3339.  
  3340.  m_bitget 1✓1✓1✓10✓0✓0✓0.........Upload a bitmap to the client program.
  3341.  
  3342.  m_bitld 1✓1✓1✓10✓0✓0✓0..........Download an image to the window.
  3343.  
  3344.  m_bitldto 1✓1✓1✓10✓0✓0✓0........Down load an image to a scratchpad bitmap.
  3345.  
  3346.  m_bitload|✓- 3✓3✓3✓31✓1✓1✓1.......Download an image into the window.
  3347.  
  3348.  m_bitsave 1✓1✓1✓10✓0✓0✓0........Copy a scratchpad bitmap to a file.
  3349.  
  3350.  m_bitwrite 1✓1✓1✓10✓0✓0✓0.......Set, Clear or Invert a rectangular portion of the window.
  3351.  
  3352.  m_bitwriteto 1✓1✓1✓11✓1✓1✓1.....Set, Clear or Invert a rectangular portion of a scratchpad
  3353.                      bitmap.
  3354.  
  3355.  m_func 1✓1✓1✓13✓3✓3✓3...........Set the bit-blt function.
  3356.  
  3357.  m_othersave 1✓1✓1✓19✓9✓9✓9......Save another client's window image in a file.
  3358.  
  3359.  m_windowsave 2✓2✓2✓28✓8✓8✓8.....Save the window image on a file.
  3360.  
  3361.  
  3362.  
  3363.  
  3364.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  3365.  
  3366.  
  3367.  
  3368.  
  3369.  
  3370.  MGR-C Language Application Interface- 49 -    Macros and Functions by Category
  3371.  
  3372.  
  3373.  _✓W_✓i_✓n_✓d_✓o_✓w _✓E_✓n_✓v_✓i_✓r_✓o_✓n_✓m_✓e_✓n_✓t _✓C_✓h_✓a_✓n_✓g_✓e_✓s
  3374.  
  3375.  
  3376.  
  3377.  m_clearmode 1✓1✓1✓11✓1✓1✓1......Reset a window mode.
  3378.  
  3379.  m_dupkey 1✓1✓1✓13✓3✓3✓3.........Turn on keyboard escape mechanism.
  3380.  
  3381.  m_font 1✓1✓1✓13✓3✓3✓3...........Change to a new font.
  3382.  
  3383.  m_loadfont 1✓1✓1✓18✓8✓8✓8.......Download a font.
  3384.  
  3385.  m_movemouse 1✓1✓1✓18✓8✓8✓8......Move the mouse position.
  3386.  
  3387.  m_movewindow 1✓1✓1✓19✓9✓9✓9.....Move a window.
  3388.  
  3389.  m_setmode 2✓2✓2✓25✓5✓5✓5........Set a window mode.
  3390.  
  3391.  m_shapewindow 2✓2✓2✓27✓7✓7✓7....Reposition a window.
  3392.  
  3393.  m_size 2✓2✓2✓27✓7✓7✓7...........Resize a window to a specified number of rows and columns.
  3394.  
  3395.  m_sizeall 2✓2✓2✓27✓7✓7✓7........Reposition a window  with  a  given  number  of  rows  and
  3396.                      columns.
  3397.  
  3398.  
  3399.  _✓W_✓i_✓n_✓d_✓o_✓w _✓S_✓t_✓a_✓t_✓e _✓I_✓n_✓q_✓u_✓i_✓r_✓y
  3400.  
  3401.  
  3402.  
  3403.  get_all|✓- 2✓2✓2✓29✓9✓9✓9.........Get all window status.
  3404.  
  3405.  get_client|✓- 2✓2✓2✓29✓9✓9✓9......Get alternate window status.
  3406.  
  3407.  get_colrow|✓- 2✓2✓2✓29✓9✓9✓9......Get window size, in columns and rows.
  3408.  
  3409.  get_cursor|✓- 2✓2✓2✓29✓9✓9✓9......Get cursor position.
  3410.  
  3411.  get_eachclientwin|✓- 2✓2✓2✓29✓9✓9✓9Get window parameters for each window.
  3412.  
  3413.  get_eachwin|✓- 2✓2✓2✓29✓9✓9✓9.....Get window parameters for each window.
  3414.  
  3415.  get_font|✓- 3✓3✓3✓30✓0✓0✓0........Get character font size.
  3416.  
  3417.  get_mouse|✓- 3✓3✓3✓30✓0✓0✓0.......Get mouse position.
  3418.  
  3419.  get_param|✓- 3✓3✓3✓30✓0✓0✓0.......Get MGR system parameters.
  3420.  
  3421.  get_size|✓- 3✓3✓3✓30✓0✓0✓0........Get the window size and position on the display.
  3422.  
  3423.  get_termcap|✓- 3✓3✓3✓30✓0✓0✓0.....Get a TERMCAP entry.
  3424.  
  3425.  is_active|✓- 3✓3✓3✓30✓0✓0✓0.......See if the window is the active window.
  3426.  
  3427.  
  3428.  
  3429.  
  3430.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  3431.  
  3432.  
  3433.  
  3434.  
  3435.  
  3436.  MGR-C Language Application Interface- 50 -    Macros and Functions by Category
  3437.  
  3438.  
  3439.  m_getinfo 1✓1✓1✓14✓4✓4✓4........Ask MGR for information.
  3440.  
  3441.  m_whatsat 2✓2✓2✓28✓8✓8✓8........Find out what is at a particular display location.
  3442.  
  3443.  
  3444.  _✓P_✓o_✓p-_✓u_✓p _✓M_✓e_✓n_✓u _✓M_✓a_✓n_✓a_✓g_✓e_✓m_✓e_✓n_✓t
  3445.  
  3446.  
  3447.  
  3448.  m_clearmenu 1✓1✓1✓11✓1✓1✓1......Clear a menu.
  3449.  
  3450.  m_linkmenu 1✓1✓1✓17✓7✓7✓7.......Link two menus together.
  3451.  
  3452.  m_loadmenu 1✓1✓1✓18✓8✓8✓8.......Down load a menu.
  3453.  
  3454.  m_nomenu 1✓1✓1✓19✓9✓9✓9.........Unselect a pop-up menu from the middle mouse button.
  3455.  
  3456.  m_nomenu2 1✓1✓1✓19✓9✓9✓9........Unselect a pop-up menu from the end mouse button.
  3457.  
  3458.  m_pagemenu 1✓1✓1✓19✓9✓9✓9.......Break a large menu into pages.
  3459.  
  3460.  m_selectmenu 2✓2✓2✓22✓2✓2✓2.....Select a pop-up menu for the middle mouse button.
  3461.  
  3462.  m_selectmenu2 2✓2✓2✓22✓2✓2✓2....Select a pop-up menu for the right mouse button.
  3463.  
  3464.  m_unlinkmenu 2✓2✓2✓27✓7✓7✓7.....Unlink a menu.
  3465.  
  3466.  m_unpagemenu 2✓2✓2✓28✓8✓8✓8.....Disconnect two pages of a paged menu.
  3467.  
  3468.  menu_load|✓- 3✓3✓3✓30✓0✓0✓0.......Down load a pop-up menu.
  3469.  
  3470.  
  3471.  _✓E_✓v_✓e_✓n_✓t _✓H_✓a_✓n_✓d_✓l_✓i_✓n_✓g
  3472.  
  3473.  
  3474.  
  3475.  m_clearevent 1✓1✓1✓11✓1✓1✓1.....Clear an event.
  3476.  
  3477.  m_setevent 2✓2✓2✓23✓3✓3✓3.......Set an event.
  3478.  
  3479.  
  3480.  _✓W_✓i_✓n_✓d_✓o_✓w _✓C_✓o_✓n_✓t_✓e_✓x_✓t _✓M_✓a_✓n_✓i_✓p_✓u_✓l_✓a_✓t_✓i_✓o_✓n
  3481.  
  3482.  
  3483.  
  3484.  m_pop 1✓1✓1✓19✓9✓9✓9............Pop the window context.
  3485.  
  3486.  m_popall 1✓1✓1✓19✓9✓9✓9.........Pop all stacked window contexts.
  3487.  
  3488.  m_push 1✓1✓1✓19✓9✓9✓9...........Stack the window context.
  3489.  
  3490.  m_pushsave 2✓2✓2✓20✓0✓0✓0.......Stack and save the window context.
  3491.  
  3492.  
  3493.  
  3494.  
  3495.  
  3496.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  3497.  
  3498.  
  3499.  
  3500.  
  3501.  
  3502.  MGR-C Language Application Interface- 51 -    Macros and Functions by Category
  3503.  
  3504.  
  3505.  _✓M_✓u_✓l_✓t_✓i_✓p_✓l_✓e _✓W_✓i_✓n_✓d_✓o_✓w_✓s
  3506.  
  3507.  
  3508.  
  3509.  m_destroywin 1✓1✓1✓12✓2✓2✓2.....Destroy an alternate window.
  3510.  
  3511.  m_halfwin 1✓1✓1✓17✓7✓7✓7........Create a window with no process connected to it.
  3512.  
  3513.  m_makewindow|✓- 3✓3✓3✓31✓1✓1✓1....Make an alternate window.
  3514.  
  3515.  m_newwin 1✓1✓1✓19✓9✓9✓9.........Make a new window.
  3516.  
  3517.  m_selectwin 2✓2✓2✓22✓2✓2✓2......Select an alternate window for output.
  3518.  
  3519.  
  3520.  _✓M_✓e_✓s_✓s_✓a_✓g_✓e _✓P_✓a_✓s_✓s_✓i_✓n_✓g
  3521.  
  3522.  
  3523.  
  3524.  m_broadcast 1✓1✓1✓11✓1✓1✓1......Broadcast a message to all listeners.
  3525.  
  3526.  m_put 2✓2✓2✓21✓1✓1✓1............Save characters in the global snarf buffer.
  3527.  
  3528.  m_sendme 2✓2✓2✓22✓2✓2✓2.........Send string back to self.
  3529.  
  3530.  m_sendto 2✓2✓2✓22✓2✓2✓2.........Send a message to another window.
  3531.  
  3532.  m_snarf 2✓2✓2✓27✓7✓7✓7..........Retrieve the contents of the global snarf buffer.
  3533.  
  3534.  
  3535.  _✓M_✓i_✓s_✓c_✓e_✓l_✓l_✓a_✓n_✓e_✓o_✓u_✓s _✓F_✓u_✓n_✓c_✓t_✓i_✓o_✓n_✓s
  3536.  
  3537.  
  3538.  
  3539.  m_aligntext 9✓9✓9✓9.......Align character cursor with the graphics point.
  3540.  
  3541.  m_down 1✓1✓1✓13✓3✓3✓3...........Move character  cursor  down  by  tenths  of  a  character
  3542.                      height.
  3543.  
  3544.  m_highlight 1✓1✓1✓17✓7✓7✓7......Highlight a portion of the display.
  3545.  
  3546.  m_incr 1✓1✓1✓17✓7✓7✓7...........Adjust the character cursor position.
  3547.  
  3548.  m_left 1✓1✓1✓17✓7✓7✓7...........Move character cursor left by tenths of a character width.
  3549.  
  3550.  m_movecursor 1✓1✓1✓18✓8✓8✓8.....Move the character cursor to an arbitrary coordinate loca-
  3551.                      tion.
  3552.  
  3553.  m_moveprint 1✓1✓1✓19✓9✓9✓9......Print a string at a given location.
  3554.  
  3555.  m_right 2✓2✓2✓22✓2✓2✓2..........Move character cursor  right  by  tenths  of  a  character
  3556.                      width.
  3557.  
  3558.  m_sleep 2✓2✓2✓27✓7✓7✓7..........Do nothing.
  3559.  
  3560.  
  3561.  
  3562.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568.  MGR-C Language Application Interface- 52 -    Macros and Functions by Category
  3569.  
  3570.  
  3571.  m_up 2✓2✓2✓28✓8✓8✓8.............Move character cursor up by tenths of a character height.
  3572.  
  3573.  
  3574.  _✓C_✓o_✓l_✓o_✓r _✓M_✓a_✓n_✓i_✓p_✓u_✓l_✓a_✓t_✓i_✓o_✓n
  3575.  
  3576.  
  3577.  
  3578.  m_bcolor 9✓9✓9✓9..........Set the text background color.
  3579.  
  3580.  m_fcolor 1✓1✓1✓13✓3✓3✓3.........Set the text foreground color.
  3581.  
  3582.  m_linecolor 1✓1✓1✓17✓7✓7✓7......Set the graphics mode and color.
  3583.  
  3584.  
  3585.  
  3586.  
  3587.  
  3588.  
  3589.  
  3590.  
  3591.  
  3592.  
  3593.  
  3594.  
  3595.  
  3596.  
  3597.  
  3598.  
  3599.  
  3600.  
  3601.  
  3602.  
  3603.  
  3604.  
  3605.  
  3606.  
  3607.  
  3608.  
  3609.  
  3610.  
  3611.  
  3612.  
  3613.  
  3614.  
  3615.  
  3616.  
  3617.  
  3618.  
  3619.  
  3620.  
  3621.  
  3622.  
  3623.  
  3624.  
  3625.  
  3626.  
  3627.  
  3628.                                       July 7, 1988         MGR 4.0  c 1988 Bellcore
  3629.  
  3630.  
  3631.  
  3632.  
  3633.  
  3634.      MGR-C Language Application Interface- 53 -           Macro and Function Index
  3635.  
  3636.  
  3637.      => _✓M_✓a_✓c_✓r_✓o _✓a_✓n_✓d _✓F_✓u_✓n_✓c_✓t_✓i_✓o_✓n _✓I_✓n_✓d_✓e_✓x
  3638.  
  3639.      These are the pages where macros and functions are referenced.  The _✓i_✓t_✓a_✓l_✓i_✓c
  3640.      page numbers are the defining references.
  3641.  
  3642.      get_all _✓2_✓9, 30             m_dupkey 12, _✓1_✓3            m_putchar _✓2_✓1
  3643.      get_client _✓2_✓9              m_ellipse 11, _✓1_✓3           m_rcircle _✓2_✓1
  3644.      get_colrow _✓2_✓9              m_ellipseto _✓1_✓3             m_rellipse _✓2_✓1
  3645.      get_cursor _✓2_✓9              menu_load _✓3_✓0, 33           m_resetesc _✓2_✓1
  3646.      get_eachclientwin _✓2_✓9       m_fastdraw _✓1_✓3, 22          m_rfastdraw 13, _✓2_✓1
  3647.      get_eachwin _✓2_✓9             m_fcolor 9, _✓1_✓3, 17         m_right 13, 17, _✓2_✓2,
  3648.      get_font _✓3_✓0                m_flush _✓1_✓3, 31             28
  3649.      get_mouse _✓3_✓0               m_font _✓1_✓3, 18, 20,         m_scrollregion _✓2_✓2
  3650.      get_param _✓3_✓0               21, 30                     m_selectmenu 18, _✓2_✓2
  3651.      get_size _✓3_✓0                m_func 9, 11, 12, _✓1_✓3,      m_selectmenu2 _✓2_✓2
  3652.      get_termcap _✓3_✓0             17, 21, 26                 m_selectwin 13, 19,
  3653.      is_active _✓3_✓0               m_getchar _✓1_✓4               _✓2_✓2, 31
  3654.      m_addchar _✓9                m_getinfo _✓1_✓4, 19, 22,      m_sendme _✓2_✓2
  3655.      m_addchars _✓9               23, 26, 27, 30             m_sendto _✓2_✓2, 23, 25
  3656.      m_addline _✓9                m_gets _✓1_✓4, 23              m_setecho _✓2_✓2
  3657.      m_addlines _✓9               m_go 9, 13, _✓1_✓7             m_setesc 21, _✓2_✓2
  3658.      m_aligntext _✓9              m_gotext _✓1_✓7                m_setevent 11, 19,
  3659.      m_arc _✓9                    m_halfwin _✓1_✓7               22, _✓2_✓3
  3660.      m_bcolor _✓9, 13             m_highlight _✓1_✓7             m_setmode 11, 12, 16,
  3661.      m_bell _✓9                   m_incr _✓1_✓7                  20, 21, _✓2_✓5, 27
  3662.      m_bitcopy _✓9                m_lastline 29, _✓3_✓1          m_setnoecho _✓2_✓6
  3663.      m_bitcopyto _✓9, 10          m_left 13, _✓1_✓7, 22, 28      m_setnoraw _✓2_✓6
  3664.      m_bitcreate _✓9, 10          m_line 14, _✓1_✓7              m_setraw _✓2_✓6
  3665.      m_bitdestroy _✓1_✓0            m_linecolor 9, 13, _✓1_✓7      m_setup 13, 19, _✓3_✓1,
  3666.      m_bitfile _✓3_✓1               m_lineto _✓1_✓7                33
  3667.      m_bitfromfile _✓1_✓0, 31       m_linkmenu _✓1_✓7, 19, 27      m_shapewindow _✓2_✓7
  3668.      m_bitget _✓1_✓0                m_loadfont 13, _✓1_✓8          m_size _✓2_✓7
  3669.      m_bitld _✓1_✓0                 m_loadmenu _✓1_✓8, 22          m_sizeall _✓2_✓7
  3670.      m_bitldto _✓1_✓0               m_makewindow 14, 15,       m_sleep _✓2_✓7
  3671.      m_bitload _✓3_✓1               _✓3_✓1                         m_snarf 21, 25, _✓2_✓7
  3672.      m_bitsave _✓1_✓0, 19, 28       m_move _✓1_✓8                  m_standend _✓2_✓7
  3673.      m_bitwrite _✓1_✓0, 14          m_movecursor _✓1_✓8, 19        m_standout _✓2_✓7
  3674.      m_bitwriteto 10, _✓1_✓1        m_movemouse _✓1_✓8             m_stringto 10, _✓2_✓7
  3675.      m_broadcast _✓1_✓1, 22         m_moveprint _✓1_✓9             m_textregion 18, 22,
  3676.      m_circle _✓1_✓1                m_movewindow _✓1_✓9            _✓2_✓7
  3677.      m_clear _✓1_✓1, 16             m_newwin 12, 17, 22,       m_textreset _✓2_✓7
  3678.      m_cleareol _✓1_✓1              23                         m_ttyreset 31, _✓3_✓2
  3679.      m_cleareos _✓1_✓1              m_nomenu _✓1_✓9                m_ttyset 31, _✓3_✓2
  3680.      m_clearevent _✓1_✓1            m_nomenu2 _✓1_✓9               m_unlinkmenu 18, 19,
  3681.      m_clearmenu _✓1_✓1             m_othersave 10, _✓1_✓9,        _✓2_✓7
  3682.      m_clearmode _✓1_✓1, 16,        28                         m_unpagemenu 19, _✓2_✓8
  3683.      25, 27                     m_pagemenu _✓1_✓9, 28          m_up 13, 17, 22, _✓2_✓8
  3684.      m_deletechar _✓1_✓2            m_pop _✓1_✓9, 20               m_whatsat _✓2_✓8
  3685.      m_deletechars _✓1_✓2           m_popall _✓1_✓9, 20, 33        m_windowsave 10, 19,
  3686.      m_deleteline _✓1_✓2            m_printstr _✓1_✓9              _✓2_✓8
  3687.      m_deletelines _✓1_✓2           m_push 7, 12, _✓1_✓9, 20,
  3688.      m_destroywin _✓1_✓2            21
  3689.      m_down _✓1_✓3, 17, 22, 28      m_pushsave 19, _✓2_✓0
  3690.      m_draw _✓1_✓3                  m_put _✓2_✓1, 24, 27
  3691.  
  3692.  
  3693.  
  3694.                                   July 7, 1988         MGR 4.0  c 1988 Bellcore
  3695.  
  3696.  
  3697.